r5387 vince - /branches/vince/netsurf-fb/framebuffer/fb_cursor.c

netsurf at semichrome.net netsurf at semichrome.net
Sun Sep 21 00:38:13 BST 2008


Author: vince
Date: Sat Sep 20 18:38:13 2008
New Revision: 5387

URL: http://source.netsurf-browser.org?rev=5387&view=rev
Log:
last try at stopping the pointer segfault

Modified:
    branches/vince/netsurf-fb/framebuffer/fb_cursor.c

Modified: branches/vince/netsurf-fb/framebuffer/fb_cursor.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-fb/framebuffer/fb_cursor.c?rev=5387&r1=5386&r2=5387&view=diff
==============================================================================
--- branches/vince/netsurf-fb/framebuffer/fb_cursor.c (original)
+++ branches/vince/netsurf-fb/framebuffer/fb_cursor.c Sat Sep 20 18:38:13 2008
@@ -85,8 +85,12 @@
         if ((fb->height - fb->cursor->y - 1) < height)
                 height = (fb->height - fb->cursor->y - 1);
 
-        if (height == 0)
-                return;
+        if (height == 0) {
+                if (fb->cursor->savedata != NULL)
+                        free(fb->cursor->savedata);
+                fb->cursor->savedata = NULL;
+                return;
+        }
 
         savelen = ((fb->cursor->width * fb->bpp) / 8);
         savebuf = malloc(savelen * height);




More information about the netsurf-commits mailing list