diff options
author | Ronald Bultje <rsbultje@gmail.com> | 2011-06-20 15:07:56 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-06-20 22:18:27 +0200 |
commit | 20153fb8f6ce7f482298170d2700befe898fa1cd (patch) | |
tree | 29976783c0bfacb4a16c8deeca108f4979627c11 /libavcodec | |
parent | d42aaa802e2b74dcb83d426001557f8229b1b484 (diff) | |
download | ffmpeg-20153fb8f6ce7f482298170d2700befe898fa1cd.tar.gz |
error_resilience: skip last-MV predictor step if MVs are not available.
Fixes crashes when playing broken MPEG2-TS streams.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/error_resilience.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index ad7a7c6ac6..8906b49c80 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -534,6 +534,9 @@ skip_mean_and_median: ff_thread_await_progress((AVFrame *) s->last_picture_ptr, mb_y, 0); } + if (!s->last_picture.motion_val[0] || + !s->last_picture.ref_index[0]) + goto skip_last_mv; prev_x = s->last_picture.motion_val[0][mot_index][0]; prev_y = s->last_picture.motion_val[0][mot_index][1]; prev_ref = s->last_picture.ref_index[0][4*mb_xy]; @@ -548,6 +551,7 @@ skip_mean_and_median: mv_predictor[pred_count][1]= prev_y; ref [pred_count] = prev_ref; pred_count++; + skip_last_mv: s->mv_dir = MV_DIR_FORWARD; s->mb_intra=0; |