From 3d260f6e75da2ee2b1dd0b933e9f2552cf66f2d5 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Fri, 2 Jan 2009 15:10:33 +0000 Subject: Fix warnings and formatting svn path=/trunk/netsurf/; revision=5956 --- gtk/gtk_throbber.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gtk/gtk_throbber.c') diff --git a/gtk/gtk_throbber.c b/gtk/gtk_throbber.c index 86b5f3318..6e46c8523 100644 --- a/gtk/gtk_throbber.c +++ b/gtk/gtk_throbber.c @@ -125,7 +125,12 @@ bool nsgtk_throbber_initialise_from_gif(const char *fn) /* allocate a block of sufficient size, and load the data in. */ data = (unsigned char *)malloc(size); - fread(data, size, 1, fh); + if (fread(data, size, 1, fh) != 1) { + /* interesting; we couldn't read it all in. */ + fclose(fh); + free(data); + return false; + } fclose(fh); /* create our gif animation */ -- cgit v1.2.3