imageio/*dec,Read*: add input parameter checks

Change-Id: I5e069d6ea4da9d8c71be03ef99aad679dd1aad21
This commit is contained in:
James Zern
2016-10-13 03:43:50 +00:00
parent 4eb5df28d1
commit 2a2773ea29
5 changed files with 14 additions and 3 deletions

View File

@ -266,6 +266,8 @@ int ReadJPEG(const uint8_t* const data, size_t data_size,
JSAMPROW buffer[1];
JPEGReadContext ctx;
if (data == NULL || data_size == 0 || pic == NULL) return 0;
(void)keep_alpha;
memset(&ctx, 0, sizeof(ctx));
ctx.data = data;