goto fail1;
}
*device_unique_name = unique_name;
+ unique_name = NULL;
// success, loop will end now
}
} else {
av_log(avctx, AV_LOG_INFO, " \"%s\"\n", friendly_name);
av_log(avctx, AV_LOG_INFO, " Alternative name \"%s\"\n", unique_name);
- av_free(unique_name);
}
fail1:
IMalloc_Free(co_malloc, olestr);
if (bind_ctx)
IBindCtx_Release(bind_ctx);
- av_free(friendly_name);
+ av_freep(&friendly_name);
+ av_freep(&unique_name);
if (bag)
IPropertyBag_Release(bag);
IMoniker_Release(m);
AVStream *st;
int ret = AVERROR(EIO);
+ type.pbFormat = NULL;
+
st = avformat_new_stream(avctx, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
if (par->codec_id == AV_CODEC_ID_NONE) {
av_log(avctx, AV_LOG_ERROR, "Unknown compression type. "
"Please report type 0x%X.\n", (int) bih->biCompression);
- return AVERROR_PATCHWELCOME;
+ ret = AVERROR_PATCHWELCOME;
+ goto error;
}
par->bits_per_coded_sample = bih->biBitCount;
} else {
ret = 0;
error:
+ if (type.pbFormat)
+ CoTaskMemFree(type.pbFormat);
return ret;
}
return 1;
}
+
+static void
+libAVPin_Free(libAVPin *this)
+{
+ if (!this)
+ return;
+ av_freep(&this->imemvtbl);
+ if (this->type.pbFormat) {
+ CoTaskMemFree(this->type.pbFormat);
+ this->type.pbFormat = NULL;
+ }
+}
DECLARE_CREATE(libAVPin, libAVPin_Setup(this, filter), libAVFilter *filter)
-DECLARE_DESTROY(libAVPin, nothing)
+DECLARE_DESTROY(libAVPin, libAVPin_Free)
/*****************************************************************************
* libAVMemInputPin