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>2017-05-28 14:30:46 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-28 14:32:12 +0300
commitd8030c14bd7ac983b81ebe898631979f6b5aea09 (patch)
tree35d0249ee2ea88a25a5ca68a898508cb4a24c626 /libavcodec/sheervideo.c
parentc51357d206f2ad58c9d9610cf85b6ea5dd88f501 (diff)
avcodec/sheervideo: Check input buffer size before allocating and decoding
Fixes: Timeout Fixes: 1858/clusterfuzz-testcase-minimized-6450473802399744 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/sheervideo.c')
-rw-r--r--libavcodec/sheervideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c
index 092ac6ed82..6f99b5c869 100644
--- a/libavcodec/sheervideo.c
+++ b/libavcodec/sheervideo.c
@@ -3105,6 +3105,11 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_PATCHWELCOME;
}
+ if (avpkt->size < 20 + avctx->width * avctx->height / 16) {
+ av_log(avctx, AV_LOG_ERROR, "Input packet too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (s->format != format) {
if (ret < 0)
return ret;