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>2019-05-19 18:42:04 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-05-20 19:10:54 +0300
commit3c0bfa7d1a90a22d5fe8daa415cc689c111562f1 (patch)
treef4dc2d61df62fc7be483bc688217961873693e78 /libavcodec/cpia.c
parentfbdb3aa179939616bc7fb26e3fe386b85b58e467 (diff)
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>
Diffstat (limited to 'libavcodec/cpia.c')
-rw-r--r--libavcodec/cpia.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
index 58833b2f26..f6d7332606 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)