summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/gdv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index 9cf30c09e4..a5ce6b799e 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -308,7 +308,7 @@ static int decompress_5(AVCodecContext *avctx, unsigned skip)
int len;
int b = bytestream2_get_byte(gb);
if (b == 0) {
- break;
+ return 0;
}
if (b != 0xFF) {
len = b;
@@ -323,6 +323,8 @@ static int decompress_5(AVCodecContext *avctx, unsigned skip)
lz_copy(pb, g2, off, len);
}
}
+ if (bytestream2_get_bytes_left_p(pb) > 0)
+ return AVERROR_INVALIDDATA;
return 0;
}
@@ -445,6 +447,9 @@ static int decompress_68(AVCodecContext *avctx, unsigned skip, unsigned use8)
}
}
+ if (bytestream2_get_bytes_left_p(pb) > 0)
+ return AVERROR_INVALIDDATA;
+
return 0;
}