You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avconv_hw: Free device on initialisation failure
This commit is contained in:
@@ -75,7 +75,7 @@ int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
|
|||||||
char *type_name = NULL, *name = NULL, *device = NULL;
|
char *type_name = NULL, *name = NULL, *device = NULL;
|
||||||
enum AVHWDeviceType type;
|
enum AVHWDeviceType type;
|
||||||
HWDevice *dev, *src;
|
HWDevice *dev, *src;
|
||||||
AVBufferRef *device_ref;
|
AVBufferRef *device_ref = NULL;
|
||||||
int err;
|
int err;
|
||||||
const char *errmsg, *p, *q;
|
const char *errmsg, *p, *q;
|
||||||
size_t k;
|
size_t k;
|
||||||
@@ -208,6 +208,7 @@ invalid:
|
|||||||
fail:
|
fail:
|
||||||
av_log(NULL, AV_LOG_ERROR,
|
av_log(NULL, AV_LOG_ERROR,
|
||||||
"Device creation failed: %d.\n", err);
|
"Device creation failed: %d.\n", err);
|
||||||
|
av_buffer_unref(&device_ref);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user