summaryrefslogtreecommitdiff
path: root/libavcodec/xxan.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-03-06 09:06:16 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 08:11:22 +0100
commit8a49d2bcbe7573bb4b765728b2578fac0d19763f (patch)
tree1454a812d4748305dcc3221a970bf9c43e7b9f62 /libavcodec/xxan.c
parent6c7d339afcd114f77d765d79863514c263e9c2f0 (diff)
xxan: fix invalid memory access in xan_decode_frame_type0()
The loop a few lines below the xan_unpack() call accesses up to dec_size * 2 bytes into y_buffer, so dec_size must be limited to buffer_size / 2. CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/xxan.c')
-rw-r--r--libavcodec/xxan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 47ab54a7f9..2bc9ff697b 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -308,7 +308,7 @@ static int xan_decode_frame_type0(AVCodecContext *avctx)
int dec_size;
bytestream2_seek(&s->gb, 8 + corr_off, SEEK_SET);
- dec_size = xan_unpack(s, s->scratch_buffer, s->buffer_size);
+ dec_size = xan_unpack(s, s->scratch_buffer, s->buffer_size / 2);
if (dec_size < 0)
dec_size = 0;
for (i = 0; i < dec_size; i++)