From 497e7330e8e52c36584367d85e6f06a647e8ce20 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 12 Oct 2008 14:03:42 +0000 Subject: [PATCH] libpipi: sometimes imlib_load_image() succeeds but imlib_image_get_data() returns NULL. Working around this properly. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2934 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/codec/imlib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pipi/codec/imlib.c b/pipi/codec/imlib.c index 712df36..8083d52 100644 --- a/pipi/codec/imlib.c +++ b/pipi/codec/imlib.c @@ -38,6 +38,13 @@ pipi_image_t *pipi_load_imlib2(const char *name) return NULL; imlib_context_set_image(priv); + + if(!imlib_image_get_data()) + { + imlib_free_image(); + return NULL; + } + img = pipi_new(imlib_image_get_width(), imlib_image_get_height()); img->p[PIPI_PIXELS_RGBA_C].pixels = imlib_image_get_data();