summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/flicvideo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 7f9b871dc7..ccc6cb25b3 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -199,6 +199,9 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
num_chunks = bytestream2_get_le16(&g2);
bytestream2_skip(&g2, 8); /* skip padding */
+ if (frame_size < 16)
+ return AVERROR_INVALIDDATA;
+
frame_size -= 16;
/* iterate through the chunks */
@@ -523,6 +526,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
if (frame_size > buf_size)
frame_size = buf_size;
+ if (frame_size < 16)
+ return AVERROR_INVALIDDATA;
frame_size -= 16;
/* iterate through the chunks */
@@ -815,6 +820,8 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx,
if (frame_size > buf_size)
frame_size = buf_size;
+ if (frame_size < 16)
+ return AVERROR_INVALIDDATA;
frame_size -= 16;
/* iterate through the chunks */