comparison tools/lib64gfx.c @ 1580:72f809e6eb3c

Add NULL check for growbuf pointer.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 May 2018 20:34:29 +0300
parents 86373ac0861a
children 3c9e5962eca6
comparison
equal deleted inserted replaced
1579:4288b21e97b9 1580:72f809e6eb3c
1100 1100
1101 int dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) 1101 int dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
1102 { 1102 {
1103 int res; 1103 int res;
1104 1104
1105 if (img == NULL || fmt == NULL) 1105 if (buf == NULL || img == NULL || fmt == NULL)
1106 return DMERR_NULLPTR; 1106 return DMERR_NULLPTR;
1107 1107
1108 if ((fmt->flags & DM_FMT_WR) == 0) 1108 if ((fmt->flags & DM_FMT_WR) == 0)
1109 return DMERR_NOT_SUPPORTED; 1109 return DMERR_NOT_SUPPORTED;
1110 1110