Fix buffer size check for xan_unpack which was broken by r18586

Originally committed as revision 18589 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Reimar Döffinger 16 years ago
parent c644665f42
commit 16cc5a738c
  1. 2
      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); back = ((opcode & 0x10) << 12) + 1 + bytestream_get_be16(&src);
size2 = *src++ + 5 + ((opcode & 0xc) << 6); size2 = *src++ + 5 + ((opcode & 0xc) << 6);
if (dest >= dest_end || size > dest_end - dest) if (size + size2 > dest_end - dest)
return; return;
} }
memcpy(dest, src, size); dest += size; src += size; memcpy(dest, src, size); dest += size; src += size;

Loading…
Cancel
Save