diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-01-07 23:57:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-09 17:19:10 +0100 |
commit | 3d71024f8ab35721f674f116ac84d734a1c6d517 (patch) | |
tree | 4e88e279fa6ab672e9b53f0cfef2084e09c11e14 /libavcodec | |
parent | b834dc14da082473e532da2baff1b28ce85f2b49 (diff) | |
download | ffmpeg-3d71024f8ab35721f674f116ac84d734a1c6d517.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>
Diffstat (limited to 'libavcodec')
-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 20b9d41426..08e4195c82 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -111,6 +111,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); |