X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fhevc.c;h=d8da18d95a405241745ddd2874a28ee9c9abdbe1;hb=9d1d7b367eeb74dbfb8501580e6c3568f3fe5973;hp=7f79189adaf9c21ff3e66898663719f77c0c7dff;hpb=7e2717ba3c645dbfc5d97e763bc79e73665739ec;p=ffmpeg diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 7f79189adaf..d8da18d95a4 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2896,9 +2896,12 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, return ret; if (avctx->hwaccel) { - if (s->ref && avctx->hwaccel->end_frame(avctx) < 0) + if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); + ff_hevc_unref_frame(s, s->ref, ~0); + return ret; + } } else { /* verify the SEI checksum */ if (avctx->err_recognition & AV_EF_CRCCHECK && s->is_decoded &&