avdevice/dshow_enummediatypes: check return of av_malloc

Untested.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-10-26 14:49:21 -04:00
parent b456ece557
commit 6f1ddc726f
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ libAVEnumMediaTypes_Next(libAVEnumMediaTypes *this, unsigned long n,
if (!this->pos && n == 1) { if (!this->pos && n == 1) {
if (!IsEqualGUID(&this->type.majortype, &GUID_NULL)) { if (!IsEqualGUID(&this->type.majortype, &GUID_NULL)) {
AM_MEDIA_TYPE *type = av_malloc(sizeof(AM_MEDIA_TYPE)); AM_MEDIA_TYPE *type = av_malloc(sizeof(AM_MEDIA_TYPE));
if (!type)
return E_OUTOFMEMORY;
ff_copy_dshow_media_type(type, &this->type); ff_copy_dshow_media_type(type, &this->type);
*types = type; *types = type;
count = 1; count = 1;