[FFmpeg-cvslog] avconv_hw: Free device on initialisation failure

Mark Thompson git at videolan.org
Thu Nov 2 01:59:57 EET 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Fri Jun 16 23:18:55 2017 +0100| [c2b0bea40f1fd4399ff6184a2df4f397c0f4b3ab] | committer: Mark Thompson

avconv_hw: Free device on initialisation failure

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2b0bea40f1fd4399ff6184a2df4f397c0f4b3ab
---

 avtools/avconv_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/avtools/avconv_hw.c b/avtools/avconv_hw.c
index 94be723304..36ef866927 100644
--- a/avtools/avconv_hw.c
+++ b/avtools/avconv_hw.c
@@ -75,7 +75,7 @@ int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
     char *type_name = NULL, *name = NULL, *device = NULL;
     enum AVHWDeviceType type;
     HWDevice *dev, *src;
-    AVBufferRef *device_ref;
+    AVBufferRef *device_ref = NULL;
     int err;
     const char *errmsg, *p, *q;
     size_t k;
@@ -208,6 +208,7 @@ invalid:
 fail:
     av_log(NULL, AV_LOG_ERROR,
            "Device creation failed: %d.\n", err);
+    av_buffer_unref(&device_ref);
     goto done;
 }
 



More information about the ffmpeg-cvslog mailing list