[FFmpeg-devel] [PATCH v1] doc/examples/transcoding: set ret before goto end

sunzhenliang hisunzhenliang at outlook.com
Mon Mar 7 06:04:55 EET 2022


Signed-off-by: sunzhenliang <hisunzhenliang at outlook.com>
---
 doc/examples/transcoding.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c
index badfba62cb..24e64e572e 100644
--- a/doc/examples/transcoding.c
+++ b/doc/examples/transcoding.c
@@ -524,8 +524,10 @@ int main(int argc, char **argv)
         goto end;
     if ((ret = init_filters()) < 0)
         goto end;
-    if (!(packet = av_packet_alloc()))
+    if (!(packet = av_packet_alloc())) {
+        ret = AVERROR(ENOMEM);
         goto end;
+    }
 
     /* read all packets */
     while (1) {
-- 
2.25.1



More information about the ffmpeg-devel mailing list