[FFmpeg-cvslog] avcodec/gdv: Check for truncated tags in decompress_5()
Michael Niedermayer
git at videolan.org
Thu Mar 28 18:34:37 EET 2019
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 25 01:26:30 2019 +0100| [98fa61c020722f7251435f3377eba449127962d8] | committer: Michael Niedermayer
avcodec/gdv: Check for truncated tags in decompress_5()
Testcase: 13169/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5666354038833152
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 5cf42f65b60d226d1223d2100cb1d90402189275)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98fa61c020722f7251435f3377eba449127962d8
---
libavcodec/gdv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index d4d24931c9..98bdee5aca 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -244,6 +244,8 @@ static int decompress_5(AVCodecContext *avctx, unsigned skip)
while (bytestream2_get_bytes_left_p(pb) > 0 && bytestream2_get_bytes_left(gb) > 0) {
int tag = read_bits2(&bits, gb);
+ if (bytestream2_get_bytes_left(gb) < 1)
+ return AVERROR_INVALIDDATA;
if (tag == 0) {
bytestream2_put_byte(pb, bytestream2_get_byte(gb));
} else if (tag == 1) {
More information about the ffmpeg-cvslog
mailing list