lavc: fix hw_device_ctx operation
authorwm4 <nfxjfg@googlemail.com>
Mon, 23 Oct 2017 22:28:03 +0000 (00:28 +0200)
committerMark Thompson <sw@jkqxz.net>
Mon, 23 Oct 2017 22:35:31 +0000 (23:35 +0100)
Commit b46a77f19d accidentally broke this (requested change that was
added to the patch later and which was not fully tested).

Signed-off-by: Mark Thompson <sw@jkqxz.net>
libavcodec/decode.c

index 54cda53..27f75d7 100644 (file)
@@ -698,11 +698,9 @@ int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx,
     ret = avcodec_get_hw_frames_parameters(avctx,
                                            avctx->hw_device_ctx,
                                            avctx->hwaccel->pix_fmt,
-                                           avctx->hw_frames_ctx);
-    if (ret < 0) {
-        av_buffer_unref(&avctx->hw_frames_ctx);
+                                           &avctx->hw_frames_ctx);
+    if (ret < 0)
         return ret;
-    }
 
     frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;