End startcode prefix search at the end of a AVC unit.
Fixes issue1550. Originally committed as revision 20784 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f543f636a5
commit
52255d1746
@ -7521,7 +7521,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
|||||||
next_avc= buf_index + nalsize;
|
next_avc= buf_index + nalsize;
|
||||||
} else {
|
} else {
|
||||||
// start code prefix search
|
// start code prefix search
|
||||||
for(; buf_index + 3 < buf_size; buf_index++){
|
for(; buf_index + 3 < next_avc; buf_index++){
|
||||||
// This should always succeed in the first iteration.
|
// This should always succeed in the first iteration.
|
||||||
if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
|
if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
|
||||||
break;
|
break;
|
||||||
@ -7530,6 +7530,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
|||||||
if(buf_index+3 >= buf_size) break;
|
if(buf_index+3 >= buf_size) break;
|
||||||
|
|
||||||
buf_index+=3;
|
buf_index+=3;
|
||||||
|
if(buf_index >= next_avc) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
hx = h->thread_context[context_count];
|
hx = h->thread_context[context_count];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user