Mercurial > hg > dmlib
comparison lib64gfx.c @ 513:486067f39bc1
Add sanity checking.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 19 Nov 2012 16:10:37 +0200 |
parents | 4cdcaeb68b54 |
children | c9b9f912acfb |
comparison
equal
deleted
inserted
replaced
512:95a6b6af53f1 | 513:486067f39bc1 |
---|---|
430 | 430 |
431 int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, | 431 int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, |
432 const size_t len, const DMC64ImageFormat *fmt) | 432 const size_t len, const DMC64ImageFormat *fmt) |
433 { | 433 { |
434 int i; | 434 int i; |
435 | |
436 if (buf == NULL || img == NULL || fmt == NULL) | |
437 return DMERR_NULLPTR; | |
435 | 438 |
436 memset(img, 0, sizeof(*img)); | 439 memset(img, 0, sizeof(*img)); |
437 img->type = fmt->type; | 440 img->type = fmt->type; |
438 | 441 |
439 for (i = 0; i < fmt->ndecencOps; i++) | 442 for (i = 0; i < fmt->ndecencOps; i++) |