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:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-13 04:33:50 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-20 00:16:00 +0300
commite7b023e1db9fb13175929c02a02846d03510ec91 (patch)
tree8d848a6ed1250d882eefe63f62b5c5bc858214a2 /libavcodec/dvdsubdec.c
parentc88afa44c4823aba7b6f4a1b01fd6a4169643c57 (diff)
avcodec/dvdsubdec: Sanity check len in decode_rle()
Fixes: Timeout Fixes: 9778/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5186007132536832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 13d52c8c68..632a53adab 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -125,6 +125,8 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, uint8_t used_
len = decode_run_8bit(&gb, &color);
else
len = decode_run_2bit(&gb, &color);
+ if (len != INT_MAX && len > w - x)
+ return AVERROR_INVALIDDATA;
len = FFMIN(len, w - x);
memset(d + x, color, len);
used_color[color] = 1;