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 04:18:02 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-02 02:14:38 +0300
commit1d589a93b07c107f13bf526f43d96f071fa4bd6a (patch)
treeefd17b8a36e4bfa0fad41d5e8c504a3b243290e5
parentd2476bd465a103df57eeaa71f68751bef5f71bf9 (diff)
avcodec/wnv1: More strict buffer size check
This requires at least 25% of a picture to allocate and decode it Fixes: Timeout Fixes: 1845/clusterfuzz-testcase-minimized-5075974343360512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7f50c25124a015a539823077bb302ff0c7ce8963) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wnv1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 126c01a02d..915e9c7dc9 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -68,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx,
int prev_y = 0, prev_u = 0, prev_v = 0;
uint8_t *rbuf;
- if (buf_size <= 8) {
+ if (buf_size < 8 + avctx->height * (avctx->width/2)/8) {
av_log(avctx, AV_LOG_ERROR, "Packet size %d is too small\n", buf_size);
return AVERROR_INVALIDDATA;
}