Browse Source

Avoid a crash when H264 MMC operation causes the short term reference

list to be emptied.
Patch by Jeff Downs: [heydowns borg com]

Originally committed as revision 10416 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Jeff Downs Benoit Fouet 18 years ago
parent
commit
088ed4d636
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/h264.c

+ 2
- 2
libavcodec/h264.c View File

@@ -3159,8 +3159,8 @@ static Picture * remove_short(H264Context *h, int frame_num){
av_log(h->s.avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic);
if(pic->frame_num == frame_num){
h->short_ref[i]= NULL;
memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i - 1)*sizeof(Picture*));
h->short_ref_count--;
if (--h->short_ref_count)
memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i)*sizeof(Picture*));
return pic;
}
}


Loading…
Cancel
Save