mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-22 07:20:45 +00:00
avconv_hw: Free device on initialisation failure
Fixes CID 1412852.
(cherry picked from commit c2b0bea40f
)
This commit is contained in:
parent
70808859dd
commit
f434ddf48e
@ -77,7 +77,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;
|
||||
@ -210,6 +210,7 @@ invalid:
|
||||
fail:
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Device creation failed: %d.\n", err);
|
||||
av_buffer_unref(&device_ref);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user