Commit 5230cba7 authored by lorenm's avatar lorenm

fix crash on negative POC


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4278 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ccd9cf47
...@@ -3156,11 +3156,11 @@ static int fill_default_ref_list(H264Context *h){ ...@@ -3156,11 +3156,11 @@ static int fill_default_ref_list(H264Context *h){
if(h->slice_type==B_TYPE){ if(h->slice_type==B_TYPE){
int out_i; int out_i;
int limit= -1; int limit= INT_MIN;
/* sort frame according to poc in B slice */ /* sort frame according to poc in B slice */
for(out_i=0; out_i<h->short_ref_count; out_i++){ for(out_i=0; out_i<h->short_ref_count; out_i++){
int best_i=-1; int best_i=INT_MIN;
int best_poc=INT_MAX; int best_poc=INT_MAX;
for(i=0; i<h->short_ref_count; i++){ for(i=0; i<h->short_ref_count; i++){
...@@ -3171,7 +3171,7 @@ static int fill_default_ref_list(H264Context *h){ ...@@ -3171,7 +3171,7 @@ static int fill_default_ref_list(H264Context *h){
} }
} }
assert(best_i != -1); assert(best_i != INT_MIN);
limit= best_poc; limit= best_poc;
sorted_short_ref[out_i]= *h->short_ref[best_i]; sorted_short_ref[out_i]= *h->short_ref[best_i];
......
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