changeset 513:486067f39bc1

Add sanity checking.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 16:10:37 +0200
parents 95a6b6af53f1
children c9b9f912acfb
files lib64gfx.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib64gfx.c	Mon Nov 19 15:53:16 2012 +0200
+++ b/lib64gfx.c	Mon Nov 19 16:10:37 2012 +0200
@@ -433,6 +433,9 @@
 {
     int i;
 
+    if (buf == NULL || img == NULL || fmt == NULL)
+        return DMERR_NULLPTR;
+
     memset(img, 0, sizeof(*img));
     img->type = fmt->type;