aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/xan.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-17 19:07:16 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-17 19:07:16 +0000
commit16cc5a738c31fdec1bdd6cadec8b30b825344e9f (patch)
tree888576c19311c43cab659db195a8ed7e3bb8be11 /libavcodec/xan.c
parentc644665f42d12bd84c414b52f2d32833b14d2196 (diff)
downloadffmpeg-16cc5a738c31fdec1bdd6cadec8b30b825344e9f.tar.gz
Fix buffer size check for xan_unpack which was broken by r18586
Originally committed as revision 18589 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index f1e343e88d..04f2b1f249 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -156,7 +156,7 @@ static void xan_unpack(unsigned char *dest, const unsigned char *src, int dest_l
back = ((opcode & 0x10) << 12) + 1 + bytestream_get_be16(&src);
size2 = *src++ + 5 + ((opcode & 0xc) << 6);
- if (dest >= dest_end || size > dest_end - dest)
+ if (size + size2 > dest_end - dest)
return;
}
memcpy(dest, src, size); dest += size; src += size;