Updated Opus encoder/decoder libraries to v1.3 (2018-10-17) and Opus-Tools to v0...
[LameXP.git] / etc / Patches / FAAD-v2.8.6-Win32-BufferOverflow-Fix.diff
blob624804328f03dc3f43a8c59db94cf0920bdba87e
1 frontend/main.c | 9 +++++----
2 1 file changed, 5 insertions(+), 4 deletions(-)
4 diff --git a/frontend/main.c b/frontend/main.c
5 index 34d4eab..0453bbe 100644
6 --- a/frontend/main.c
7 +++ b/frontend/main.c
8 @@ -70,6 +70,7 @@
9 #define MAX_CHANNELS 6 /* make this higher to support files with
10 more channels */
12 +#define MAX_PERCENTS 384
14 static int quiet = 0;
16 @@ -469,7 +470,7 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std
17 NeAACDecFrameInfo frameInfo;
18 NeAACDecConfigurationPtr config;
20 - char percents[200];
21 + char percents[MAX_PERCENTS];
22 int percent, old_percent = -1;
23 int bread, fileread;
24 int header_type = 0;
25 @@ -734,7 +735,7 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std
26 if (percent > old_percent)
28 old_percent = percent;
29 - sprintf(percents, "%d%% decoding %s.", percent, aacfile);
30 + snprintf(percents, MAX_PERCENTS, "%d%% decoding %s.", percent, aacfile);
31 faad_fprintf(stderr, "%s\r", percents);
32 #ifdef _WIN32
33 SetConsoleTitle(percents);
34 @@ -802,7 +803,7 @@ static int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_std
35 NeAACDecFrameInfo frameInfo;
36 mp4AudioSpecificConfig mp4ASC;
38 - char percents[200];
39 + char percents[MAX_PERCENTS];
40 int percent, old_percent = -1;
42 int first_time = 1;
43 @@ -979,7 +980,7 @@ static int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_std
44 if (percent > old_percent)
46 old_percent = percent;
47 - sprintf(percents, "%d%% decoding %s.", percent, mp4file);
48 + snprintf(percents, MAX_PERCENTS, "%d%% decoding %s.", percent, mp4file);
49 faad_fprintf(stderr, "%s\r", percents);
50 #ifdef _WIN32
51 SetConsoleTitle(percents);