# HG changeset patch # User lorenm # Date 1116478086 0 # Node ID 16258de8ae06cc69eee93a220b4a9f5df3dfeb02 # Parent 9c1a436dac6bed115dca3f41cf72af9dadade6a7 fix crash on negative POC diff -r 9c1a436dac6b -r 16258de8ae06 h264.c --- a/h264.c Thu May 19 02:43:21 2005 +0000 +++ b/h264.c Thu May 19 04:48:06 2005 +0000 @@ -3156,11 +3156,11 @@ if(h->slice_type==B_TYPE){ int out_i; - int limit= -1; + int limit= INT_MIN; /* sort frame according to poc in B slice */ for(out_i=0; out_ishort_ref_count; out_i++){ - int best_i=-1; + int best_i=INT_MIN; int best_poc=INT_MAX; for(i=0; ishort_ref_count; i++){ @@ -3171,7 +3171,7 @@ } } - assert(best_i != -1); + assert(best_i != INT_MIN); limit= best_poc; sorted_short_ref[out_i]= *h->short_ref[best_i];