]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/decode: actually propagate AVHWAccel.alloc_frame() return value
authorJames Almer <jamrial@gmail.com>
Fri, 29 May 2020 18:07:41 +0000 (15:07 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 4 Jun 2020 12:58:27 +0000 (09:58 -0300)
Finishes fixing the regression introduced in a1133db30ef07896afd96f067e5c51531a4e85ab
after the partial fix in b6d6597bef66531ec07c07a7125b88aee38fb220.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/decode.c

index eed89a89a708abbbfb83ec5aaa7a173f9dc76bac..a4e50c0d03189488b323c1ff94c736d59d0be949 100644 (file)
@@ -1911,10 +1911,12 @@ end:
         frame->height = avctx->height;
     }
 
-    return 0;
 fail:
-    av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-    av_frame_unref(frame);
+    if (ret < 0) {
+        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        av_frame_unref(frame);
+    }
+
     return ret;
 }