aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-04-20 18:11:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-04-22 01:06:35 +0200
commit0dd99b0238089c06c429e9658e7506eb44c0b083 (patch)
tree0c147f1e2bd7aed0e1c6f8fc8e2c770e866e5314
parent3b2994552a9882b54c34a401b0f89078c7474b0b (diff)
downloadffmpeg-0dd99b0238089c06c429e9658e7506eb44c0b083.tar.gz
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 Reviewed-by: Paul B Mahol <onemda@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f17e8e90bb1fe5e4db18cc6dde9522417108c7bd) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ccaption_dec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 33e2130f8e..4706094249 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.