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