# | Line 151 | Line 151 | BMPopenReader(int (*cget)(void *), int (*seek)(uint32, | |
---|---|---|
151 | ||
152 | if (cget == NULL) | |
153 | return NULL; | |
154 | + | if (cget == &stdio_getc && c_data == NULL) |
155 | + | return NULL; /* stdio error condition */ |
156 | magic[0] = (*cget)(c_data); | |
157 | if (magic[0] != 'B') | |
158 | return NULL; | |
# | Line 628 | Line 630 | BMPopenWriter(void (*cput)(int, void *), int (*seek)(u | |
630 | /* check arguments */ | |
631 | if (cput == NULL) | |
632 | return NULL; | |
633 | + | if (cput == &stdio_putc && c_data == NULL) |
634 | + | return NULL; /* stdio error condition */ |
635 | if (!BMPheaderOK(hdr)) | |
636 | return NULL; | |
637 | if ((hdr->bpp == 16) | (hdr->compr == BI_RLE4)) |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |