comparison h264.c @ 4828:58f1856608f6 libavcodec

scenario: A properly coded frame is followed by an end of sequence NAL unit, i.e. the four bytes 00 00 01 0a. When decode_nal() decodes the end of sequence NAL unit, it returns with dst_length == 0. The original code leads to a return -1 which discards the current properly decoded frame. patch by Reinhard Nissl, rnissl gmx de
author diego
date Mon, 09 Apr 2007 12:55:07 +0000
parents 522e52c630bd
children e3161603a048
comparison
equal deleted inserted replaced
4827:b3ee9a1526b0 4828:58f1856608f6
8142 8142
8143 buf_index+=3; 8143 buf_index+=3;
8144 } 8144 }
8145 8145
8146 ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index); 8146 ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
8147 if (ptr==NULL || dst_length <= 0){ 8147 if (ptr==NULL || dst_length < 0){
8148 return -1; 8148 return -1;
8149 } 8149 }
8150 while(ptr[dst_length - 1] == 0 && dst_length > 1) 8150 while(ptr[dst_length - 1] == 0 && dst_length > 1)
8151 dst_length--; 8151 dst_length--;
8152 bit_length= 8*dst_length - decode_rbsp_trailing(h, ptr + dst_length - 1); 8152 bit_length= 8*dst_length - decode_rbsp_trailing(h, ptr + dst_length - 1);