diff mbox series

[FFmpeg-devel,6/7] avutil/frame: Return 0 on success in av_frame_ref()

Message ID HE1PR0301MB2154B0F67C12A21E99D47CFB8F7B9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 416cc012f6203c7162079ae5b14930ada9189ac3
Headers show
Series [FFmpeg-devel,1/7] avformat/utils: Check allocations for failure
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 1, 2021, 9:26 p.m. UTC
av_frame_copy() is allowed to return values >= 0 on success, whereas
the documentation of av_frame_ref() states that the return value is 0 on
success. Ergo the latter must not just return the former's return value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/frame.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 31a2117b82..fefb2b69c0 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -469,7 +469,7 @@  int av_frame_ref(AVFrame *dst, const AVFrame *src)
         if (ret < 0)
             goto fail;
 
-        return ret;
+        return 0;
     }
 
     /* ref the buffers */