diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2006-02-13 18:13:13 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2006-02-13 18:13:13 +0000 |
commit | 171c407621b7ff52a0cf128b31651ca927c2dd49 (patch) | |
tree | 2dd27fd7b20b4bb884426b74da91297d13c8bfb1 /libavcodec | |
parent | 6eb7182cf4f9d8fb9f8c40e4ec25ee42ebac425a (diff) | |
download | ffmpeg-171c407621b7ff52a0cf128b31651ca927c2dd49.tar.gz |
fix some crashes when missing frames
Originally committed as revision 5019 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 014d635f6b..4c2f0cb7ec 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1202,7 +1202,7 @@ static inline void direct_ref_list_init(H264Context * const h){ for(list=0; list<2; list++){ for(i=0; i<ref1->ref_count[list]; i++){ const int poc = ref1->ref_poc[list][i]; - h->map_col_to_list0[list][i] = PART_NOT_AVAILABLE; + h->map_col_to_list0[list][i] = 0; /* bogus; fills in for missing frames */ for(j=0; j<h->ref_count[list]; j++) if(h->ref_list[list][j].poc == poc){ h->map_col_to_list0[list][i] = j; @@ -2607,7 +2607,8 @@ static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square, const int pic_width = 16*s->mb_width; const int pic_height = 16*s->mb_height; - assert(pic->data[0]); + if(!pic->data[0]) + return; if(mx&7) extra_width -= 3; if(my&7) extra_height -= 3; @@ -7774,7 +7775,9 @@ static int decode_frame(AVCodecContext *avctx, } out_of_order = !cross_idr && prev && out->poc < prev->poc; - if(prev && pics <= s->avctx->has_b_frames) + if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames) + { } + else if(prev && pics <= s->avctx->has_b_frames) out = prev; else if((out_of_order && pics-1 == s->avctx->has_b_frames && pics < 15) || (s->low_delay && |