aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Strange <astrange@ithinksw.com>2011-12-12 18:13:39 -0500
committerAnton Khirnov <anton@khirnov.net>2011-12-23 08:32:18 +0100
commitbc6a3bd4a544608211f006e2d2868cbed4e1fde6 (patch)
tree284accd6fccee29dfb75742f025e947b59d74d12
parent82d05e78a60d5b2b3ecfaa3aa232df518c351274 (diff)
downloadffmpeg-bc6a3bd4a544608211f006e2d2868cbed4e1fde6.tar.gz
h264: Fix a possible overread in decode_nal_units()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/h264.c2
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++];