diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-08-05 19:54:41 +0200 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2015-08-06 11:05:02 +0200 |
commit | 94c0df79c7e8205b9e0ae560bc4ac831c231abb8 (patch) | |
tree | 975bfc9e70b316768b59d4f008de22f16a8b393d /libavcodec/hevc.c | |
parent | ace837665362297a761ca92309ece8d7f4fa725a (diff) | |
download | ffmpeg-94c0df79c7e8205b9e0ae560bc4ac831c231abb8.tar.gz |
lavc: propagate hwaccel errors
At least the new videotoolbox decoder does not actually set a frame if
end_frame fails. This causes the API to return success and signals that
a picture was decoded, even though AVFrame->data[0] is NULL.
Fix this by propagating end_frame errors.
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 7f79189ada..d8da18d95a 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 && |