]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: make use of ret error out in transcode_video().
authorClément Bœsch <clement.boesch@smartjog.com>
Wed, 8 Feb 2012 16:28:02 +0000 (17:28 +0100)
committerClément Bœsch <ubitux@gmail.com>
Fri, 10 Feb 2012 19:13:36 +0000 (20:13 +0100)
ffmpeg.c

index a02b1a915106d99ba6322484688c40e376764cfa..abbd71e628ca97fad11cbeefbbf17261900e6bc1 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2135,10 +2135,10 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
                 goto cont;
             }
             if (!ist->filtered_frame && !(ist->filtered_frame = avcodec_alloc_frame())) {
-                av_free(buffer_to_free);
-                return AVERROR(ENOMEM);
-            } else
-                avcodec_get_frame_defaults(ist->filtered_frame);
+                ret = AVERROR(ENOMEM);
+                goto end;
+            }
+            avcodec_get_frame_defaults(ist->filtered_frame);
             filtered_frame = ist->filtered_frame;
             *filtered_frame= *decoded_frame; //for me_threshold
             if (ost->picref) {
@@ -2158,6 +2158,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
 #endif
     }
 
+end:
     av_free(buffer_to_free);
     return ret;
 }