diff mbox series

[FFmpeg-devel] avcodec/decode: actually propagate AVHWAccel.alloc_frame() return value

Message ID 20200529180741.4680-1-jamrial@gmail.com
State Accepted
Commit 8e7b5ba80e05eb5d58b724bec0be19611b11958a
Headers show
Series [FFmpeg-devel] avcodec/decode: actually propagate AVHWAccel.alloc_frame() return value
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

James Almer May 29, 2020, 6:07 p.m. UTC
Finishes fixing the regression introduced in a1133db30ef07896afd96f067e5c51531a4e85ab
after the partial fix in b6d6597bef66531ec07c07a7125b88aee38fb220.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/decode.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

James Almer June 3, 2020, 1:09 p.m. UTC | #1
On 5/29/2020 3:07 PM, James Almer wrote:
> Finishes fixing the regression introduced in a1133db30ef07896afd96f067e5c51531a4e85ab
> after the partial fix in b6d6597bef66531ec07c07a7125b88aee38fb220.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/decode.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index eed89a89a7..a4e50c0d03 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -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;
>  }

Will apply soon.
diff mbox series

Patch

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index eed89a89a7..a4e50c0d03 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -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;
 }