diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-09 04:32:46 +0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-04-01 20:33:29 +0400 |
commit | 5ae49ddaa447bb4fba287f92ca508caba399ffbd (patch) | |
tree | d5fe467c9930b87e2e2e71ab1bc742472922c6b7 /libavcodec | |
parent | 311361348dc5af77ad189bba846f2fdaff85a5c4 (diff) |
xxan: don't read before start of buffer in av_memcpy_backptr().
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit f1279e286b00e99f343adb51e251f036a3df6f32)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/xxan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 28c868d5ba..daaba6389a 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -129,7 +129,8 @@ static int xan_unpack(uint8_t *dest, const int dest_len, if (size + size2 > dest_end - dest) break; } - if (src + size > src_end || dest + size + size2 > dest_end) + if (src + size > src_end || dest + size + size2 > dest_end || + dest - orig_dest + size < back) return -1; bytestream_get_buffer(&src, dest, size); dest += size; |