# HG changeset patch # User michael # Date 1260362999 0 # Node ID dc61c373810e0685f6e668563b9660ac447d03a9 # Parent 80161fd66fd17e6620fca4f4a07c58b08eefb6ae End startcode prefix search at the end of a AVC unit. Fixes issue1550. diff -r 80161fd66fd1 -r dc61c373810e h264.c --- a/h264.c Wed Dec 09 00:38:22 2009 +0000 +++ b/h264.c Wed Dec 09 12:49:59 2009 +0000 @@ -7521,7 +7521,7 @@ 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 @@ if(buf_index+3 >= buf_size) break; buf_index+=3; + if(buf_index >= next_avc) continue; } hx = h->thread_context[context_count];