summaryrefslogtreecommitdiff
path: root/libavcodec/lscrdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/lscrdec.c')
-rw-r--r--libavcodec/lscrdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c
index f5cfe1fa04..042da84bf9 100644
--- a/libavcodec/lscrdec.c
+++ b/libavcodec/lscrdec.c
@@ -76,6 +76,10 @@ static int decode_idat(LSCRContext *s, int length)
int ret;
s->zstream.avail_in = FFMIN(length, bytestream2_get_bytes_left(&s->gb));
s->zstream.next_in = s->gb.buffer;
+
+ if (length <= 0)
+ return AVERROR_INVALIDDATA;
+
bytestream2_skip(&s->gb, length);
/* decode one line if possible */