Unified · Split
| @@ -2521,9 +2521,7 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 2520 unmodified lines | ||
| 2521 | 2521 | if (ret < 0) { |
| 2522 | 2522 | av_log(s->avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n", |
| 2523 | 2523 | s->nal_unit_type); |
| 2524 | − if (s->avctx->err_recognition & AV_EF_EXPLODE) | |
| 2525 | − return ret; | |
| 2526 | − return 0; | |
| 2524 | + goto fail; | |
| 2527 | 2525 | } else if (!ret) |
| 2528 | 2526 | return 0; |
| 2529 | 2527 | |
| @@ -2531,23 +2529,23 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 1 unmodified line | ||
| 2531 | 2529 | case NAL_VPS: |
| 2532 | 2530 | ret = ff_hevc_decode_nal_vps(s); |
| 2533 | 2531 | if (ret < 0) |
| 2534 | − return ret; | |
| 2532 | + goto fail; | |
| 2535 | 2533 | break; |
| 2536 | 2534 | case NAL_SPS: |
| 2537 | 2535 | ret = ff_hevc_decode_nal_sps(s); |
| 2538 | 2536 | if (ret < 0) |
| 2539 | − return ret; | |
| 2537 | + goto fail; | |
| 2540 | 2538 | break; |
| 2541 | 2539 | case NAL_PPS: |
| 2542 | 2540 | ret = ff_hevc_decode_nal_pps(s); |
| 2543 | 2541 | if (ret < 0) |
| 2544 | − return ret; | |
| 2542 | + goto fail; | |
| 2545 | 2543 | break; |
| 2546 | 2544 | case NAL_SEI_PREFIX: |
| 2547 | 2545 | case NAL_SEI_SUFFIX: |
| 2548 | 2546 | ret = ff_hevc_decode_nal_sei(s); |
| 2549 | 2547 | if (ret < 0) |
| 2550 | − return ret; | |
| 2548 | + goto fail; | |
| 2551 | 2549 | break; |
| 2552 | 2550 | case NAL_TRAIL_R: |
| 2553 | 2551 | case NAL_TRAIL_N: |
| @@ -2593,7 +2591,7 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 39 unmodified lines | ||
| 2593 | 2591 | return ret; |
| 2594 | 2592 | } else if (!s->ref) { |
| 2595 | 2593 | av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n"); |
| 2596 | − return AVERROR_INVALIDDATA; | |
| 2594 | + goto fail; | |
| 2597 | 2595 | } |
| 2598 | 2596 | |
| 2599 | 2597 | if (s->nal_unit_type != s->first_nal_type) { |
| @@ -2609,8 +2607,7 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 9 unmodified lines | ||
| 2609 | 2607 | if (ret < 0) { |
| 2610 | 2608 | av_log(s->avctx, AV_LOG_WARNING, |
| 2611 | 2609 | "Error constructing the reference lists for the current slice.\n"); |
| 2612 | − if (s->avctx->err_recognition & AV_EF_EXPLODE) | |
| 2613 | − return ret; | |
| 2610 | + goto fail; | |
| 2614 | 2611 | } |
| 2615 | 2612 | } |
| 2616 | 2613 | |
| @@ -2623,8 +2620,10 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 6 unmodified lines | ||
| 2623 | 2620 | restore_tqb_pixels(s); |
| 2624 | 2621 | } |
| 2625 | 2622 | |
| 2626 | − if (ctb_addr_ts < 0) | |
| 2627 | − return ctb_addr_ts; | |
| 2623 | + if (ctb_addr_ts < 0) { | |
| 2624 | + ret = ctb_addr_ts; | |
| 2625 | + goto fail; | |
| 2626 | + } | |
| 2628 | 2627 | break; |
| 2629 | 2628 | case NAL_EOS_NUT: |
| 2630 | 2629 | case NAL_EOB_NUT: |
| @@ -2640,6 +2639,10 @@ static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length) · 9 unmodified lines | ||
| 2640 | 2639 | } |
| 2641 | 2640 | |
| 2642 | 2641 | return 0; |
| 2642 | +fail: | |
| 2643 | + if (s->avctx->err_recognition & AV_EF_EXPLODE) | |
| 2644 | + return ret; | |
| 2645 | + return 0; | |
| 2643 | 2646 | } |
| 2644 | 2647 | |
| 2645 | 2648 | /* FIXME: This is adapted from ff_h264_decode_nal, avoiding duplication |
| @@ -2820,8 +2823,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 174 unmodified lines | ||
| 2820 | 2823 | if (ret < 0) { |
| 2821 | 2824 | av_log(s->avctx, AV_LOG_WARNING, |
| 2822 | 2825 | "Error parsing NAL unit #%d.\n", i); |
| 2823 | − if (s->avctx->err_recognition & AV_EF_EXPLODE) | |
| 2824 | − goto fail; | |
| 2826 | + goto fail; | |
| 2825 | 2827 | } |
| 2826 | 2828 | } |
| 2827 | 2829 | |