diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-10 14:33:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-14 00:21:49 +0200 |
commit | f66eaded0157b8649a6a07340ff7f85efb1b7d68 (patch) | |
tree | f2084dbb8092d69da26e9d463bbdf95304a8291c | |
parent | 452629fb23de7f0dfd4f0cbf3b7ab5f284c0f735 (diff) | |
download | ffmpeg-f66eaded0157b8649a6a07340ff7f85efb1b7d68.tar.gz |
avcodec/y41pdec: Fix width in input buffer size check
Fixes: out of array read
Fixes: 1437/clusterfuzz-testcase-minimized-4569970002362368
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 3d8d3729475c7dce52d8fb9ffb280fd2ea62e1a2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/y41pdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index 1b177d4262..85a39e4ae2 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -43,7 +43,7 @@ static int y41p_decode_frame(AVCodecContext *avctx, void *data, uint8_t *y, *u, *v; int i, j, ret; - if (avpkt->size < 3LL * avctx->height * avctx->width / 2) { + if (avpkt->size < 3LL * avctx->height * FFALIGN(avctx->width, 8) / 2) { av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n"); return AVERROR(EINVAL); } |