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-04 16:24:46 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 04:41:33 +0300
commit0a391b738ecbf36c9106b52bbeb552d3ab269032 (patch)
tree2b4dd56ea4d7453d84c335758e4f8e85e7aeb982 /libavcodec/msvideo1.c
parent533999aaadc41f2521e3e22d034a3500d1bf6e48 (diff)
avcodec/msvideo1: Check buffer size before re-getting the frame
Fixes timeout Fixes: 1306/clusterfuzz-testcase-minimized-6152296217968640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit cabfed6895fcc679cd6a6244a12d800e0f3f2d20) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/msvideo1.c')
-rw-r--r--libavcodec/msvideo1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index 0526505a96..c53ca826cb 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -302,6 +302,12 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
s->buf = buf;
s->size = buf_size;
+ // Discard frame if its smaller than the minimum frame size
+ if (buf_size < (avctx->width/4) * (avctx->height/4) / 512) {
+ av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;