diff options
author | Alexander Strange <astrange@ithinksw.com> | 2011-12-13 03:13:39 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-12-23 11:32:18 +0400 |
commit | bc6a3bd4a544608211f006e2d2868cbed4e1fde6 (patch) | |
tree | 284accd6fccee29dfb75742f025e947b59d74d12 /libavcodec/h264.c | |
parent | 82d05e78a60d5b2b3ecfaa3aa232df518c351274 (diff) |
h264: Fix a possible overread in decode_nal_units()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a9a10513e3..2bde0fec2a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3764,7 +3764,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ int err; if(buf_index >= next_avc) { - if(buf_index >= buf_size) break; + if (buf_index >= buf_size - h->nal_length_size) break; nalsize = 0; for(i = 0; i < h->nal_length_size; i++) nalsize = (nalsize << 8) | buf[buf_index++]; |