# HG changeset patch # User lorenm # Date 1150104617 0 # Node ID bd7a496e44c9a6b15dbbc739b273f766af4b5b98 # Parent 4c2eba93c584bf5cd8113a9e4485783c9cd9b4a8 h264: accept rbsp_trailing longer than 1 byte diff -r 4c2eba93c584 -r bd7a496e44c9 h264.c --- a/h264.c Fri Jun 09 22:26:03 2006 +0000 +++ b/h264.c Mon Jun 12 09:30:17 2006 +0000 @@ -7973,7 +7973,8 @@ } 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){