summaryrefslogtreecommitdiff
path: root/libavcodec/xl.c
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2011-12-20 00:00:30 +0530
committerMartin Storsjö <martin@martin.st>2011-12-19 20:36:26 +0200
commit00aad121d8a6f365641345a8321bdaac1ff80649 (patch)
tree17ba1f67014325d4463262ab97cb3a412472d95c /libavcodec/xl.c
parent1c668624725318b62e1ce9adfdbd0417da0a1633 (diff)
xl: Fix overreads
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/xl.c')
-rw-r--r--libavcodec/xl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 197b0c24a2..0ebc9467e0 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx,
V = a->pic.data[2];
stride = avctx->width - 4;
+
+ if (buf_size < avctx->width * avctx->height) {
+ av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
for (i = 0; i < avctx->height; i++) {
/* lines are stored in reversed order */
buf += stride;