Commit 9f375c61 authored by michael's avatar michael

End startcode prefix search at the end of a AVC unit.

Fixes issue1550.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20784 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent fb68cfcd
......@@ -7521,7 +7521,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
next_avc= buf_index + nalsize;
} else {
// 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.
if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1)
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;
buf_index+=3;
if(buf_index >= next_avc) continue;
}
hx = h->thread_context[context_count];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment