Commit ca923b7b authored by Mateusz Łukasik's avatar Mateusz Łukasik

New upstream version 3.8

parent 455e4bcb
......@@ -81,12 +81,12 @@ AC_REQUIRE([AC_C_BIGENDIAN])
AC_REQUIRE([AC_SYS_LARGEFILE])
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -std=gnu99 -ffast-math -Wall -pipe -Wno-deprecated-declarations"
CFLAGS="$CFLAGS -std=gnu99 -ffast-math -Wall -pipe"
if test "x$HAVE_DARWIN" = "xyes"; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++ -std=gnu++11 -ffast-math -Wall -pipe -Wno-deprecated-declarations"
CXXFLAGS="$CXXFLAGS -stdlib=libc++ -std=gnu++11 -ffast-math -Wall -pipe"
LDFLAGS="$LDFLAGS -lc++ -stdlib=libc++"
else
CXXFLAGS="$CXXFLAGS -std=gnu++11 -ffast-math -Wall -pipe -Wno-deprecated-declarations"
CXXFLAGS="$CXXFLAGS -std=gnu++11 -ffast-math -Wall -pipe"
fi
AUD_CHECK_CFLAGS(-Wtype-limits)
AUD_CHECK_CXXFLAGS(-Woverloaded-virtual)
......@@ -142,9 +142,9 @@ AC_PROG_LN_S
AC_PATH_PROG([RM], [rm])
AC_PATH_PROG([MV], [mv])
AC_PATH_PROG([CP], [cp])
AC_PATH_PROG([AR], [ar])
AC_PATH_PROG([RANLIB], [ranlib])
AC_PATH_PROG([WINDRES], [windres])
AC_PATH_TOOL([AR], [ar])
AC_PATH_TOOL([RANLIB], [ranlib])
AC_PATH_TOOL([WINDRES], [windres])
dnl Check for POSIX threads
dnl =======================
......@@ -193,10 +193,12 @@ AC_ARG_ENABLE(qt,
USE_QT=$enableval, USE_QT=no)
if test $USE_QT = yes ; then
PKG_CHECK_MODULES([QTCORE], [Qt5Core >= 5.2])
PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets >= 5.2])
AC_DEFINE(USE_QT, 1, [Define if Qt support enabled])
# needed if Qt was built with -reduce-relocations
QTCORE_CFLAGS="$QTCORE_CFLAGS -fPIC"
QT_CFLAGS="$QT_CFLAGS -fPIC"
fi
......
......@@ -46,6 +46,9 @@
/* Define if using libav */
#undef HAVE_LIBAV
/* Define if libcue version is >= 2.0 */
#undef HAVE_LIBCUE2
/* Define to 1 if you have the <lirc/lirc_client.h> header file. */
#undef HAVE_LIRC_LIRC_CLIENT_H
......@@ -82,9 +85,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* X Composite extension available */
#undef HAVE_XCOMPOSITE
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
......
This diff is collapsed.
This diff is collapsed.
......@@ -21,20 +21,18 @@ USE_QT ?= @USE_QT@
ALSA_CFLAGS ?= @ALSA_CFLAGS@
ALSA_LIBS ?= @ALSA_LIBS@
AMPACHE_CFLAGS ?= @AMPACHE_CFLAGS@
AMPACHE_LIBS ?= @AMPACHE_LIBS@
BS2B_CFLAGS ?= @BS2B_CFLAGS@
BS2B_LIBS ?= @BS2B_LIBS@
CDIO_LIBS ?= @CDIO_LIBS@
CDIO_CFLAGS ?= @CDIO_CFLAGS@
CDDB_LIBS ?= @CDDB_LIBS@
CDDB_CFLAGS ?= @CDDB_CFLAGS@
CUE_CFLAGS ?= @CUE_CFLAGS@
CUE_LIBS ?= @CUE_LIBS@
CURL_CFLAGS ?= @CURL_CFLAGS@
CURL_LIBS ?= @CURL_LIBS@
DBUS_CFLAGS ?= @DBUS_CFLAGS@
DBUS_LIBS ?= @DBUS_LIBS@
FAAD_CFLAGS ?= @FAAD_CFLAGS@
FAAD_LIBS ?= @FAAD_LIBS@
FFMPEG_CFLAGS ?= @FFMPEG_CFLAGS@
FFMPEG_LIBS ?= @FFMPEG_LIBS@
FILEWRITER_CFLAGS ?= @FILEWRITER_CFLAGS@
......@@ -75,7 +73,6 @@ SIDPLAYFP_CFLAGS ?= @SIDPLAYFP_CFLAGS@
SIDPLAYFP_LIBS ?= @SIDPLAYFP_LIBS@
SNDFILE_CFLAGS ?= @SNDFILE_CFLAGS@
SNDFILE_LIBS ?= @SNDFILE_LIBS@
SNDIO_LIBS ?= @SNDIO_LIBS@
QT_CFLAGS ?= @QT_CFLAGS@
QT_LIBS ?= @QT_LIBS@
QTMULTIMEDIA_CFLAGS ?= @QTMULTIMEDIA_CFLAGS@
......@@ -86,12 +83,10 @@ VORBIS_CFLAGS ?= @VORBIS_CFLAGS@
VORBIS_LIBS ?= @VORBIS_LIBS@
WAVPACK_CFLAGS ?= @WAVPACK_CFLAGS@
WAVPACK_LIBS ?= @WAVPACK_LIBS@
XCOMPOSITE_CFLAGS ?= @XCOMPOSITE_CFLAGS@
XCOMPOSITE_LIBS ?= @XCOMPOSITE_LIBS@
X11EXT_CFLAGS ?= @X11EXT_CFLAGS@
X11EXT_LIBS ?= @X11EXT_LIBS@
XML_CFLAGS ?= @XML_CFLAGS@
XML_LIBS ?= @XML_LIBS@
XRENDER_CFLAGS ?= @XRENDER_CFLAGS@
XRENDER_LIBS ?= @XRENDER_LIBS@
HAVE_LINUX ?= @HAVE_LINUX@
HAVE_MSWINDOWS ?= @HAVE_MSWINDOWS@
......
# Please don't update this file manually - use ./update-potfiles.sh instead!
src/aac-raw/aac.cc
src/aac/aac.cc
src/adplug/adplug-xmms.cc
src/adplug/core/rix.cc
src/adplug/core/rix.h
......@@ -9,10 +9,11 @@ src/albumart/albumart.cc
src/albumart-qt/albumart.cc
src/alsa/alsa.h
src/alsa/config.cc
src/amidi-plug/amidi-plug.cc
src/amidi-plug/i_configure.cc
src/amidi-plug/i_configure-fluidsynth.cc
src/amidi-plug/i_fileinfo.cc
src/amidiplug/amidi-plug.cc
src/amidiplug/i_configure.cc
src/amidiplug/i_configure-fluidsynth.cc
src/amidiplug/i_fileinfo.cc
src/ampache/ampache.cc
src/aosd/aosd.cc
src/aosd/aosd.h
src/aosd/aosd_style.cc
......@@ -24,7 +25,7 @@ src/audpl/audpl.cc
src/blur_scope/blur_scope.cc
src/bs2b/plugin.cc
src/cairo-spectrum/cairo-spectrum.cc
src/cdaudio-ng/cdaudio-ng.cc
src/cdaudio/cdaudio-ng.cc
src/cd-menu-items/cd-menu-items.cc
src/compressor/compressor.cc
src/console/Ay_Apu.cc
......@@ -89,14 +90,11 @@ src/delete-files/delete-files.cc
src/echo_plugin/echo.cc
src/ffaudio/ffaudio-core.cc
src/filewriter/filewriter.cc
src/filewriter/mp3.cc
src/filewriter/vorbis.cc
src/flacng/flacng.h
src/flacng/metadata.cc
src/flacng/plugin.cc
src/flac/flacng.h
src/flac/metadata.cc
src/flac/plugin.cc
src/gio/gio.cc
src/gl-spectrum/gl-spectrum.cc
src/gl-spectrum-qt/gl-spectrum.cc
src/glspectrum/gl-spectrum.cc
src/gnomeshortcuts/gnomeshortcuts.cc
src/gtkui/columns.cc
src/gtkui/layout.cc
......@@ -107,7 +105,7 @@ src/gtkui/ui_playlist_widget.cc
src/gtkui/ui_statusbar.cc
src/hotkey/gui.cc
src/hotkey/plugin.cc
src/jack-ng/jack-ng.cc
src/jack/jack-ng.cc
src/ladspa/plugin.cc
src/ladspa/plugin.h
src/lirc/lirc.cc
......@@ -133,12 +131,13 @@ src/playlist-manager-qt/playlist-manager-qt.cc
src/pls/pls.cc
src/psf/plugin.cc
src/psf/psx.h
src/pulse_audio/pulse_audio.cc
src/pulse/pulse_audio.cc
src/qtaudio/qtaudio.cc
src/qtglspectrum/gl-spectrum.cc
src/qtui/dialog_windows.cc
src/qtui/filter_input.cc
src/qtui/main_window_actions.cc
src/qtui/main_window.cc
src/qtui/menus.cc
src/qtui/playlist_model.cc
src/qtui/qtui.cc
src/qtui/settings.cc
......@@ -173,11 +172,11 @@ src/skins/search-select.cc
src/skins/skins_cfg.cc
src/skins/skinselector.cc
src/sndfile/plugin.cc
src/sndio-ng/sndio.cc
src/song_change/song_change.cc
src/sndio/sndio.cc
src/songchange/song_change.cc
src/song-info-qt/song-info.cc
src/sox-resampler/sox-resampler.cc
src/speed-pitch/speed-pitch.cc
src/soxr/sox-resampler.cc
src/speedpitch/speed-pitch.cc
src/statusicon-qt/statusicon.cc
src/statusicon/statusicon.cc
src/stereo_plugin/stereo.cc
......@@ -187,6 +186,7 @@ src/vorbis/vorbis.cc
src/vorbis/vorbis.h
src/vtx/info.cc
src/vtx/vtx.cc
src/waveout/waveout.cc
src/wavpack/wavpack.cc
src/xsf/desmume/types.h
src/xsf/plugin.cc
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,5 +10,5 @@ plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
LD = ${CXX}
CFLAGS += ${PLUGIN_CFLAGS}
CPPFLAGS += ${PLUGIN_CPPFLAGS} ${FAAD_CFLAGS} -I../..
LIBS += ${FAAD_LIBS} -lm -laudtag
CPPFLAGS += ${PLUGIN_CPPFLAGS} -I../..
LIBS += -lfaad -lm -laudtag
......@@ -19,13 +19,11 @@ public:
PACKAGE
};
static constexpr auto iinfo = InputInfo ()
.with_exts (exts);
constexpr AACDecoder () : InputPlugin (info, iinfo) {}
constexpr AACDecoder () : InputPlugin (info, InputInfo ()
.with_exts (exts)) {}
bool is_our_file (const char * filename, VFSFile & file);
Tuple read_tuple (const char * filename, VFSFile & file);
bool read_tag (const char * filename, VFSFile & file, Tuple & tuple, Index<char> * image);
bool play (const char * filename, VFSFile & file);
};
......@@ -254,24 +252,24 @@ static void calc_aac_info (VFSFile & handle, int * length, int * bitrate,
NeAACDecClose (decoder);
}
Tuple AACDecoder::read_tuple (const char * filename, VFSFile & handle)
bool AACDecoder::read_tag (const char * filename, VFSFile & file, Tuple & tuple,
Index<char> * image)
{
Tuple tuple;
int length, bitrate, samplerate, channels;
tuple.set_filename (filename);
tuple.set_str (Tuple::Codec, "MPEG-2/4 AAC");
calc_aac_info (handle, &length, &bitrate, &samplerate, &channels);
// TODO: error handling
calc_aac_info (file, &length, &bitrate, &samplerate, &channels);
if (length > 0)
tuple.set_int (Tuple::Length, length);
if (bitrate > 0)
tuple.set_int (Tuple::Bitrate, bitrate);
tuple.fetch_stream_info (handle);
tuple.fetch_stream_info (file);
return tuple;
return true;
}
static void aac_seek (VFSFile & file, NeAACDecHandle dec, int time, int len,
......@@ -330,15 +328,9 @@ bool AACDecoder::play (const char * filename, VFSFile & file)
NeAACDecConfigurationPtr decoder_config;
unsigned long samplerate = 0;
unsigned char channels = 0;
int bitrate = 0;
Tuple tuple = get_playback_tuple ();
if (tuple)
{
bitrate = tuple.get_int (Tuple::Bitrate);
bitrate = 1000 * aud::max (0, bitrate);
}
int bitrate = 1000 * aud::max (0, tuple.get_int (Tuple::Bitrate));
if ((decoder = NeAACDecOpen ()) == nullptr)
{
......@@ -400,7 +392,7 @@ bool AACDecoder::play (const char * filename, VFSFile & file)
/* == CHECK FOR METADATA == */
if (tuple && tuple.fetch_stream_info (file))
if (tuple.fetch_stream_info (file))
set_playback_tuple (tuple.ref ());
set_stream_bitrate (bitrate);
......@@ -419,8 +411,7 @@ bool AACDecoder::play (const char * filename, VFSFile & file)
if (seek_value >= 0)
{
int length = tuple ? tuple.get_int (Tuple::Length) : 0;
int length = tuple.get_int (Tuple::Length);
if (length > 0)
aac_seek (file, decoder, seek_value, length, buf, sizeof buf, & buflen);
}
......@@ -432,7 +423,7 @@ bool AACDecoder::play (const char * filename, VFSFile & file)
/* == CHECK FOR METADATA == */
if (tuple && tuple.fetch_stream_info (file))
if (tuple.fetch_stream_info (file))
set_playback_tuple (tuple.ref ());
/* == DECODE A FRAME == */
......
......@@ -5,7 +5,6 @@ SRCS = adplug-xmms.cc \
binio/binio.cc \
binio/binstr.cc \
core/fmopl.cc \
core/debug.cc \
core/adlibemu.cc \
core/adplug.cc \
core/emuopl.cc \
......@@ -64,5 +63,6 @@ plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
LD = ${CXX}
CFLAGS += ${PLUGIN_CFLAGS}
# FIXME: Turning off warnings for now; this code is awful
CXXFLAGS += ${PLUGIN_CFLAGS} -Wno-sign-compare
CPPFLAGS += ${PLUGIN_CPPFLAGS} -I../.. -I./core -I./binio
......@@ -43,16 +43,14 @@ public:
PACKAGE
};
static constexpr auto iinfo = InputInfo ()
.with_exts (exts);
constexpr AdPlugXMMS () : InputPlugin (info, iinfo) {}
constexpr AdPlugXMMS () : InputPlugin (info, InputInfo ()
.with_exts (exts)) {}
bool init ();
void cleanup ();
bool is_our_file (const char * filename, VFSFile & file);
Tuple read_tuple (const char * filename, VFSFile & file);
bool read_tag (const char * filename, VFSFile & file, Tuple & tuple, Index<char> * image);
bool play (const char * filename, VFSFile & file);
};
......@@ -123,33 +121,31 @@ dbg_printf (const char *fmt, ...)
/***** Main player (!! threaded !!) *****/
Tuple AdPlugXMMS::read_tuple (const char * filename, VFSFile & fd)
bool AdPlugXMMS::read_tag (const char * filename, VFSFile & file, Tuple & tuple,
Index<char> * image)
{
Tuple tuple;
CSilentopl tmpopl;
CFileProvider fp (fd);
CFileProvider fp (file);
CPlayer *p = CAdPlug::factory (filename, &tmpopl, fp);
if (p)
{
tuple.set_filename (filename);
if (! p)
return false;
if (! p->getauthor().empty())
tuple.set_str (Tuple::Artist, p->getauthor().c_str());
if (! p->getauthor().empty())
tuple.set_str (Tuple::Artist, p->getauthor().c_str());
if (! p->gettitle().empty())
tuple.set_str (Tuple::Title, p->gettitle().c_str());
else if (! p->getdesc().empty())
tuple.set_str (Tuple::Title, p->getdesc().c_str());
if (! p->gettitle().empty())
tuple.set_str (Tuple::Title, p->gettitle().c_str());
else if (! p->getdesc().empty())
tuple.set_str (Tuple::Title, p->getdesc().c_str());
tuple.set_str (Tuple::Codec, p->gettype().c_str());
tuple.set_str (Tuple::Quality, _("sequenced"));
tuple.set_int (Tuple::Length, p->songlength (plr.subsong));
delete p;
}
tuple.set_str (Tuple::Codec, p->gettype().c_str());
tuple.set_str (Tuple::Quality, _("sequenced"));
tuple.set_int (Tuple::Length, p->songlength (plr.subsong));
delete p;
return tuple;
return true;
}
/* Main playback thread. Takes the filename to play as argument. */
......
......@@ -157,24 +157,24 @@ bool Ca2mLoader::load(const std::string &filename, const CFileProvider &fp)
orgptr += sixdepak(secptr,orgptr,len[1]); secptr += len[1] / 2;
if(version == 1) {
if(numpats > 16)
orgptr += sixdepak(secptr,orgptr,len[2]); secptr += len[2] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[2]); secptr += len[2] / 2; }
if(numpats > 32)
orgptr += sixdepak(secptr,orgptr,len[3]); secptr += len[3] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[3]); secptr += len[3] / 2; }
if(numpats > 48)
sixdepak(secptr,orgptr,len[4]);
} else {
if(numpats > 8)
orgptr += sixdepak(secptr,orgptr,len[2]); secptr += len[2] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[2]); secptr += len[2] / 2; }
if(numpats > 16)
orgptr += sixdepak(secptr,orgptr,len[3]); secptr += len[3] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[3]); secptr += len[3] / 2; }
if(numpats > 24)
orgptr += sixdepak(secptr,orgptr,len[4]); secptr += len[4] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[4]); secptr += len[4] / 2; }
if(numpats > 32)
orgptr += sixdepak(secptr,orgptr,len[5]); secptr += len[5] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[5]); secptr += len[5] / 2; }
if(numpats > 40)
orgptr += sixdepak(secptr,orgptr,len[6]); secptr += len[6] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[6]); secptr += len[6] / 2; }
if(numpats > 48)
orgptr += sixdepak(secptr,orgptr,len[7]); secptr += len[7] / 2;
{ orgptr += sixdepak(secptr,orgptr,len[7]); secptr += len[7] / 2; }
if(numpats > 56)
sixdepak(secptr,orgptr,len[8]);
}
......
......@@ -741,7 +741,9 @@ void AdlibDriver::executePrograms() {
}
Channel &channel = _channels[_curChannel];
_curRegOffset = _regOffset[_curChannel];
if (_curChannel != 9) {
_curRegOffset = _regOffset[_curChannel];
}
if (channel.tempoReset) {
channel.tempo = _tempo;
......
......@@ -182,9 +182,3 @@ std::string CAdPlug::get_version()
{
return std::string(VERSION);
}
void CAdPlug::debug_output(const std::string &filename)
{
AdPlug_LogFile(filename.c_str());
AdPlug_LogWrite("CAdPlug::debug_output(\"%s\"): Redirected.\n",filename.c_str());
}
......@@ -43,7 +43,6 @@ public:
static void set_database(CAdPlugDatabase *db);
static std::string get_version();
static void debug_output(const std::string &filename);
private:
static CAdPlugDatabase *database;
......
......@@ -62,7 +62,7 @@ bool CadtrackLoader::load(const std::string &filename, const CFileProvider &fp)
AdPlug_LogWrite("CadtrackLoader::load(,\"%s\"): Checking for \"%s\"...\n",
filename.c_str(), instfilename.c_str());
instf = fp.open(instfilename);
if(!instf || fp.filesize(instf) != 468) { fp.close(f); return false; }
if(!instf || fp.filesize(instf) != 468) { if(instf) { fp.close(instf); } fp.close(f); return false; }
// give CmodPlayer a hint on what we're up to
realloc_patterns(1,1000,9); realloc_instruments(9); realloc_order(1);
......
......@@ -111,11 +111,13 @@ bool CxadbmfPlayer::xadplayer_load()
ptr = 6;
strncpy(bmf.title,(char *)&tune[ptr],36);
bmf.title[35] = 0;
while (tune[ptr]) { ptr++; }
ptr++;
strncpy(bmf.author,(char *)&tune[ptr],36);
bmf.author[35] = 0;
while (tune[ptr]) { ptr++; }
ptr++;
......
/*
* Adplug - Replayer for many OPL2/OPL3 audio file formats.
* Copyright (C) 1999 - 2002 Simon Peter <dn.tlp@gmx.net>, et al.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* debug.h - AdPlug Debug Logger
* Copyright (c) 2002 Riven the Mage <riven@ok.ru>
* Copyright (c) 2002 Simon Peter <dn.tlp@gmx.net>
*/
#ifdef DEBUG
#include <stdio.h>
#include <stdarg.h>
static FILE *log = NULL;
void AdPlug_LogFile(const char *filename)
{
if(log) fclose(log);
log = fopen(filename,"wt");
}
void AdPlug_LogWrite(const char *fmt, ...)
{
va_list argptr;
va_start(argptr, fmt);
if(log) {
vfprintf(log, fmt, argptr);
fflush(log);
} else
vfprintf(stderr, fmt, argptr);
va_end(argptr);
}
#else
void AdPlug_LogFile(const char *filename) { }
void AdPlug_LogWrite(const char *fmt, ...) { }
#endif
......@@ -32,7 +32,8 @@
#ifndef H_DEBUG
#define H_DEBUG
void AdPlug_LogFile(const char *filename);
void AdPlug_LogWrite(const char *fmt, ...);
#include <libaudcore/runtime.h>
#define AdPlug_LogWrite(...) AUDDBG(__VA_ARGS__)
#endif
......@@ -64,7 +64,8 @@ bool CdfmLoader::load(const std::string &filename, const CFileProvider &fp)
inst[i].data[0] = f->readInt(1);
}
for(i = 0; i < 128; i++) order[i] = f->readInt(1);
for(i = 0; i < 128 && order[i] != 128; i++) continue; length = i;
for(i = 0; i < 128 && order[i] != 128; i++) continue;
length = i;
npats = f->readInt(1);
for(i = 0; i < npats; i++) {
n = f->readInt(1);
......
......@@ -51,8 +51,15 @@ bool ChspLoader::load(const std::string &filename, const CFileProvider &fp)
if(j >= orgsize) break; // memory boundary check
memset(org + j, cmp[i + 1], j + cmp[i] < orgsize ? cmp[i] : orgsize - j - 1);