Skip to content

Commit

Permalink
avdevice/dshow_enummediatypes: check return of av_malloc
Browse files Browse the repository at this point in the history
Untested.

Reviewed-by: Michael Niedermayer <[email protected]>
Signed-off-by: Ganesh Ajjanagadde <[email protected]>
  • Loading branch information
Ganesh Ajjanagadde committed Nov 6, 2015
1 parent b456ece commit 6f1ddc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavdevice/dshow_enummediatypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ libAVEnumMediaTypes_Next(libAVEnumMediaTypes *this, unsigned long n,
if (!this->pos && n == 1) {
if (!IsEqualGUID(&this->type.majortype, &GUID_NULL)) {
AM_MEDIA_TYPE *type = av_malloc(sizeof(AM_MEDIA_TYPE));
if (!type)
return E_OUTOFMEMORY;
ff_copy_dshow_media_type(type, &this->type);
*types = type;
count = 1;
Expand Down

0 comments on commit 6f1ddc7

Please sign in to comment.