diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-05-19 17:42:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-02 19:41:48 +0100 |
commit | 2f8d30fb9b53c0227d7d2a10785d969b75093519 (patch) | |
tree | afead33dd2b578512af957f44ebc0d88ef10ad6a | |
parent | b55cf5f53d3ee1619314d8a43f7a34e203d7969f (diff) | |
download | ffmpeg-2f8d30fb9b53c0227d7d2a10785d969b75093519.tar.gz |
avcodec/cpia: Check input size also against linesizes and EOL
Fixes: Timeout (14sec -> 29ms)
Fixes: 14733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5707022445576192
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3c0bfa7d1a90a22d5fe8daa415cc689c111562f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/cpia.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index 6b784b2051..72c5803db1 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -63,7 +63,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, uint8_t *y, *u, *v, *y_end, *u_end, *v_end; // Check header - if ( avpkt->size < FRAME_HEADER_SIZE + if ( avpkt->size < FRAME_HEADER_SIZE + avctx->height * 3 || header[0] != MAGIC_0 || header[1] != MAGIC_1 || (header[17] != SUBSAMPLE_420 && header[17] != SUBSAMPLE_422) || (header[18] != YUVORDER_YUYV && header[18] != YUVORDER_UYVY) |