OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f3e56b
)
h264: check buffer size before accessing it
author
Anton Khirnov
<anton@khirnov.net>
Fri, 15 Nov 2013 09:15:24 +0000
(10:15 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Thu, 21 Nov 2013 19:54:20 +0000
(20:54 +0100)
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
libavcodec/h264.c
patch
|
blob
|
history
diff --git
a/libavcodec/h264.c
b/libavcodec/h264.c
index
62e4940
..
86d453b
100644
(file)
--- a/
libavcodec/h264.c
+++ b/
libavcodec/h264.c
@@
-4554,7
+4554,7
@@
static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
h->workaround_bugs |= FF_BUG_TRUNCATED;
if (!(h->workaround_bugs & FF_BUG_TRUNCATED))
- while (
ptr[dst_length - 1] == 0 && dst_length >
0)
+ while (
dst_length > 0 && ptr[dst_length - 1] ==
0)
dst_length--;
bit_length = !dst_length ? 0
: (8 * dst_length -