aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-06-22 01:18:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-10 01:52:56 +0200
commit3b02b9ad2b81fb536587d45ee7463aaf1fa93a4c (patch)
tree617c1567b28148a12d18dc8213f7d76e66484fed
parent9bfdb49b74026f380488cd857f0dddf7bb3834ca (diff)
downloadffmpeg-3b02b9ad2b81fb536587d45ee7463aaf1fa93a4c.tar.gz
avcodec/cscd: Check output buffer size for lzo.
Fixes: Timeout Fixes: 8665/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5768442610188288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg (cherry picked from commit 78167b498f53c36c31105a2bf11e90b03637598f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cscd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 8cb193de56..8fd121a2c7 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -81,7 +81,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
switch ((buf[0] >> 1) & 7) {
case 0: { // lzo compression
int outlen = c->decomp_size, inlen = buf_size - 2;
- if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen)) {
+ if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || outlen) {
av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n");
return AVERROR_INVALIDDATA;
}