[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec h264.c,1.125,1.126
Michael Niedermayer CVS
michael
Sat May 14 02:04:18 CEST 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv15449
Modified Files:
h264.c
Log Message:
fill missing reference pictures with something to avoid assertion failure
Index: h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- h264.c 13 May 2005 12:00:12 -0000 1.125
+++ h264.c 14 May 2005 00:04:11 -0000 1.126
@@ -3197,6 +3197,8 @@
for(i=0; i<h->short_ref_count && index < h->ref_count[list]; i++, j+=step) {
while(j<0 || j>= h->short_ref_count){
+ if(j != -99 && step == (list ? -1 : 1))
+ return -1;
step = -step;
j= smallest_poc_greater_than_current + (step>>1);
}
@@ -3264,7 +3266,7 @@
static int decode_ref_pic_list_reordering(H264Context *h){
MpegEncContext * const s = &h->s;
- int list;
+ int list, index;
print_short_term(h);
print_long_term(h);
@@ -3275,7 +3277,6 @@
if(get_bits1(&s->gb)){
int pred= h->curr_pic_num;
- int index;
for(index=0; ; index++){
int reordering_of_pic_nums_idc= get_ue_golomb(&s->gb);
@@ -3339,6 +3340,13 @@
if(h->slice_type!=B_TYPE) break;
}
+ for(list=0; list<2; list++){
+ for(index= 0; index < h->ref_count[list]; index++){
+ if(!h->ref_list[list][index].data[0])
+ h->ref_list[list][index]= s->current_picture;
+ }
+ if(h->slice_type!=B_TYPE) break;
+ }
if(h->slice_type==B_TYPE && !h->direct_spatial_mv_pred)
direct_dist_scale_factor(h);
More information about the ffmpeg-cvslog
mailing list