diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-01-07 23:57:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-13 17:06:08 +0100 |
commit | 633461d8bb1d58838c48b29136f6db58712821c1 (patch) | |
tree | 7d00a5e3fa048f1d7022cf8c04974a38da495e36 | |
parent | 77c20198bbbb2b48ddef15784217e786200853f3 (diff) | |
download | ffmpeg-633461d8bb1d58838c48b29136f6db58712821c1.tar.gz |
avcodec/dvdsubdec: error on bitmaps with size 0
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcaa9099b3648b47060e1724a97dc98b63c83702)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/dvdsubdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 8beec5015a..b4032a6a19 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -101,6 +101,9 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, if (start >= buf_size) return -1; + if (w <= 0 || h <= 0) + return -1; + bit_len = (buf_size - start) * 8; init_get_bits(&gb, buf + start, bit_len); |