changeset 3341:bd7a496e44c9 libavcodec

h264: accept rbsp_trailing longer than 1 byte
author lorenm
date Mon, 12 Jun 2006 09:30:17 +0000
parents 4c2eba93c584
children ff5bed27d7ca
files h264.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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){