projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c65fb5b
)
bmv: check for len being valid in bmv_decode_frame().
author
Anton Khirnov
<anton@khirnov.net>
Thu, 28 Mar 2013 09:09:36 +0000
(10:09 +0100)
committer
Reinhard Tartler
<siretart@tauware.de>
Wed, 24 Apr 2013 19:01:14 +0000
(21:01 +0200)
It can be 0 or -1 for invalid files, which may result in invalid memory
access.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit
b88f902125ee808c8366e9dcb3f21e4c227483fc
)
Conflicts:
libavcodec/bmv.c
libavcodec/bmv.c
patch
|
blob
|
history
diff --git
a/libavcodec/bmv.c
b/libavcodec/bmv.c
index 49346a41a8d5dde1777d5ab4a01b184bb0de869c..920e75255fd643ca1ef472a6a264307b4f426391 100644
(file)
--- a/
libavcodec/bmv.c
+++ b/
libavcodec/bmv.c
@@
-134,7
+134,7
@@
static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
mode += 1 + advance_mode;
if (mode >= 4)
mode -= 3;
- if (FFABS(dst_end - dst) < len)
+ if (
len <= 0 ||
FFABS(dst_end - dst) < len)
return -1;
switch (mode) {
case 1: