From: Nathan Caldwell Date: Tue, 13 Jan 2009 05:58:56 +0000 (-0700) Subject: If we're not given any data for the Attachment, bail. X-Git-Tag: 0.6.3.1~3 X-Git-Url: https://repo.or.cz/w/libmkv.git/commitdiff_plain/1622febc69d703def3d4dccd1d036c5e507ec4d5 If we're not given any data for the Attachment, bail. --- diff --git a/src/attachments.c b/src/attachments.c index 4492c8a..e5e9e40 100644 --- a/src/attachments.c +++ b/src/attachments.c @@ -33,6 +33,10 @@ int mk_createAttachment( { mk_Context *attach; unsigned long file_uid; + + if ((data == NULL) || (size == 0)) + return -1; + /* * Generate a random UID for this Attachment. * NOTE: This probably should be a CRC32 of file data.