lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit()

All other errors should cause a failure, regardless of the value of
err_recognition. Also, print a warning message when skipping invalid NAL
units.
release/7.1
Anton Khirnov 6 months ago
parent 8eb134f4f9
commit 90fc331b0f
  1. 10
      libavcodec/hevc/hevcdec.c

@ -3206,9 +3206,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
return 0;
fail:
if (s->avctx->err_recognition & AV_EF_EXPLODE)
return ret;
return 0;
if (ret == AVERROR_INVALIDDATA &&
!(s->avctx->err_recognition & AV_EF_EXPLODE)) {
av_log(s->avctx, AV_LOG_WARNING,
"Skipping invalid undecodable NALU: %d\n", s->nal_unit_type);
return 0;
}
return ret;
}
static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)

Loading…
Cancel
Save