Re: [FFmpeg-devel] [PATCH] avcodec/ccaption_dec: Add a blank like at the end to avoid rollup reading from outside
On Mon, Apr 22, 2019 at 09:49:41AM +0200, Alexander Strasser wrote: > Hi Michael! > > On 2019-04-20 18:11 +0200, Michael Niedermayer wrote: > > Fixes: index 20 out of bounds for type 'const char *[4][128]' > > Somehow I don't understand this diagnostic message. It says "index > 20 out of bounds for [4][128]". > > You're change looks like an off-by-one fix. > > Sorry; I'm surely missing something as I didn't look up the code, > just thought I might as well ask... yes, the out of array read causes a value that is out of range to be used and later cause the quoted 2nd out of array read [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/ccaption_dec: Add a blank like at the end to avoid rollup reading from outside
Hi Michael! On 2019-04-20 18:11 +0200, Michael Niedermayer wrote: > Fixes: index 20 out of bounds for type 'const char *[4][128]' Somehow I don't understand this diagnostic message. It says "index 20 out of bounds for [4][128]". You're change looks like an off-by-one fix. Sorry; I'm surely missing something as I didn't look up the code, just thought I might as well ask... Alexander > Fixes: > 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 > > 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 > Signed-off-by: Michael Niedermayer > --- > libavcodec/ccaption_dec.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c > index 09ceb1b3bf..bf3563a0bc 100644 > --- a/libavcodec/ccaption_dec.c > +++ b/libavcodec/ccaption_dec.c > @@ -212,10 +212,10 @@ static const unsigned char pac2_attribs[32][3] = // > Color, font, ident > > struct Screen { > /* +1 is used to compensate null character of string */ > -uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t charsets[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t colors[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t fonts[SCREEN_ROWS][SCREEN_COLUMNS+1]; > +uint8_t characters[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t charsets[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t colors[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t fonts[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > /* > * Bitmask of used rows; if a bit is not set, the > * corresponding row is not used. > -- > 2.21.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/ccaption_dec: Add a blank like at the end to avoid rollup reading from outside
On 4/20/19, Michael Niedermayer wrote: > Fixes: index 20 out of bounds for type 'const char *[4][128]' > Fixes: > 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 > > 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 > Signed-off-by: Michael Niedermayer > --- > libavcodec/ccaption_dec.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c > index 09ceb1b3bf..bf3563a0bc 100644 > --- a/libavcodec/ccaption_dec.c > +++ b/libavcodec/ccaption_dec.c > @@ -212,10 +212,10 @@ static const unsigned char pac2_attribs[32][3] = // > Color, font, ident > > struct Screen { > /* +1 is used to compensate null character of string */ > -uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t charsets[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t colors[SCREEN_ROWS][SCREEN_COLUMNS+1]; > -uint8_t fonts[SCREEN_ROWS][SCREEN_COLUMNS+1]; > +uint8_t characters[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t charsets[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t colors[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > +uint8_t fonts[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; > /* > * Bitmask of used rows; if a bit is not set, the > * corresponding row is not used. > -- > 2.21.0 > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". Probably OK ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/ccaption_dec: Add a blank like at the end to avoid rollup reading from outside
Fixes: index 20 out of bounds for type 'const char *[4][128]' Fixes: 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 Signed-off-by: Michael Niedermayer --- libavcodec/ccaption_dec.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index 09ceb1b3bf..bf3563a0bc 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -212,10 +212,10 @@ static const unsigned char pac2_attribs[32][3] = // Color, font, ident struct Screen { /* +1 is used to compensate null character of string */ -uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1]; -uint8_t charsets[SCREEN_ROWS][SCREEN_COLUMNS+1]; -uint8_t colors[SCREEN_ROWS][SCREEN_COLUMNS+1]; -uint8_t fonts[SCREEN_ROWS][SCREEN_COLUMNS+1]; +uint8_t characters[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; +uint8_t charsets[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; +uint8_t colors[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; +uint8_t fonts[SCREEN_ROWS+1][SCREEN_COLUMNS+1]; /* * Bitmask of used rows; if a bit is not set, the * corresponding row is not used. -- 2.21.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".