avconv_hw: Free device on initialisation failure

Fixes CID 1412852.

(cherry picked from commit c2b0bea40f)
pull/263/head
Mark Thompson 8 years ago
parent 70808859dd
commit f434ddf48e
  1. 3
      ffmpeg_hw.c

@ -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…
Cancel
Save