Browse Source

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
remotes/tiles
sam 16 years ago
parent
commit
497e7330e8
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      pipi/codec/imlib.c

+ 7
- 0
pipi/codec/imlib.c View File

@@ -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();


Loading…
Cancel
Save