Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-01-08 01:57:50 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-01-08 03:42:42 +0300
commitbcaa9099b3648b47060e1724a97dc98b63c83702 (patch)
tree1d4e6a124c8ffda1c85daf1223ae9276096561f4 /libavcodec/dvdsubdec.c
parent3ed80bd95e1dd6864dbd08fa622d7eec97ac9a38 (diff)
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>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 2423cadcaa..1cc34ead17 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);