summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2006-06-12 09:30:17 +0000
committerLoren Merritt <lorenm@u.washington.edu>2006-06-12 09:30:17 +0000
commitc4da83fb0fe3e6c4475b6e9c48c2cc82c1c96db1 (patch)
tree943143c6652a0967df8cc797866677ffae89fbeb /libavcodec/h264.c
parenta7b286e89c0e0409b2346d2d7761dd6025acfa59 (diff)
h264: accept rbsp_trailing longer than 1 byte
Originally committed as revision 5467 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 99172a1823..2047d5fc61 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -7973,7 +7973,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
}
ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
- if(ptr[dst_length - 1] == 0) dst_length--;
+ while(ptr[dst_length - 1] == 0 && dst_length > 1)
+ dst_length--;
bit_length= 8*dst_length - decode_rbsp_trailing(ptr + dst_length - 1);
if(s->avctx->debug&FF_DEBUG_STARTCODE){