]> granicus.if.org Git - graphviz/commitdiff
try to make png image loading more robust for bug #2425
authorJohn Ellson <ellson@research.att.com>
Tue, 25 Feb 2014 21:10:28 +0000 (16:10 -0500)
committerJohn Ellson <ellson@research.att.com>
Tue, 25 Feb 2014 21:10:28 +0000 (16:10 -0500)
plugin/pango/gvloadimage_pango.c

index 41c93ce17667bbb3f448030df08511c54aa73972..2d2325dfe974de846f3c512773ceea9716fdc7da 100644 (file)
@@ -41,6 +41,8 @@ typedef enum {
 static cairo_status_t
 reader (void *closure, unsigned char *data, unsigned int length)
 {
+    if ((FILE *)closure == NULL)
+       return CAIRO_STATUS_READ_ERROR;
     if (length == fread(data, 1, length, (FILE *)closure)
      || feof((FILE *)closure))
         return CAIRO_STATUS_SUCCESS;