Fixes crashes when playing broken MPEG2-TS streams.
Unified · Split
| @@ -534,6 +534,9 @@ skip_mean_and_median: · 533 unmodified lines | |||
| 534 | ff_thread_await_progress((AVFrame *) s->last_picture_ptr, | 534 | ff_thread_await_progress((AVFrame *) s->last_picture_ptr, |
| 535 | mb_y, 0); | 535 | mb_y, 0); |
| 536 | } | 536 | } |
| 537 | if (!s->last_picture.motion_val[0] || | ||
| 538 | !s->last_picture.ref_index[0]) | ||
| 539 | goto skip_last_mv; | ||
| 537 | prev_x = s->last_picture.motion_val[0][mot_index][0]; | 540 | prev_x = s->last_picture.motion_val[0][mot_index][0]; |
| 538 | prev_y = s->last_picture.motion_val[0][mot_index][1]; | 541 | prev_y = s->last_picture.motion_val[0][mot_index][1]; |
| 539 | prev_ref = s->last_picture.ref_index[0][4*mb_xy]; | 542 | prev_ref = s->last_picture.ref_index[0][4*mb_xy]; |
| @@ -548,6 +551,7 @@ skip_mean_and_median: · 8 unmodified lines | |||
| 548 | mv_predictor[pred_count][1]= prev_y; | 551 | mv_predictor[pred_count][1]= prev_y; |
| 549 | ref [pred_count] = prev_ref; | 552 | ref [pred_count] = prev_ref; |
| 550 | pred_count++; | 553 | pred_count++; |
| 554 | skip_last_mv: | ||
| 551 | 555 | ||
| 552 | s->mv_dir = MV_DIR_FORWARD; | 556 | s->mv_dir = MV_DIR_FORWARD; |
| 553 | s->mb_intra=0; | 557 | s->mb_intra=0; |