summaryrefslogtreecommitdiff
path: root/libavcodec/gdv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-05 17:22:23 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-28 01:25:17 +0200
commit35517e3ca7ea2e243e3e29ec7d4d2a9f150f25ed (patch)
tree6f45bd86d3d6aeef3b8ff5581d1be6ec0aa75e60 /libavcodec/gdv.c
parent510bd61941548b653ae446ede199013d9af01257 (diff)
downloadffmpeg-35517e3ca7ea2e243e3e29ec7d4d2a9f150f25ed.tar.gz
avcodec/gdv: Error out if we had insufficent input for the output frame in decompress_2()
Fixes: Timeout (with the previous commits to gdv.c) Fixes: 9422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5143490001371136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/gdv.c')
-rw-r--r--libavcodec/gdv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index d497f76157..b54f7373d1 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -230,6 +230,10 @@ static int decompress_2(AVCodecContext *avctx)
break;
}
}
+
+ if (bytestream2_get_bytes_left_p(pb) > 0)
+ return AVERROR_INVALIDDATA;
+
return 0;
}
@@ -458,6 +462,8 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
default:
av_assert0(0);
}
+ if (ret < 0)
+ return ret;
memcpy(frame->data[1], gdv->pal, AVPALETTE_SIZE);
dst = frame->data[0];