diff options
author | Michael Niedermayer <[email protected]> | 2019-04-20 18:11:42 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2019-12-02 19:41:48 +0100 |
commit | aa152bcaeccbba11dd5f07a55c2231c8ade5d2a2 (patch) | |
tree | a290dc89f32894eee959eeb3c249cd65029dcb46 | |
parent | 89b9c728623fc28d090b323053cae367d596a466 (diff) |
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 <[email protected]>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit f17e8e90bb1fe5e4db18cc6dde9522417108c7bd)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/ccaption_dec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index dbd62cd8d6..51de929059 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -137,9 +137,9 @@ static const uint8_t parity_table[256] = { 0, 1, 1, 0, 1, 0, 0, 1, struct Screen { /* +1 is used to compensate null character of string */ - uint8_t characters[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 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. |