raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=22da09105d5cb37ea33c28f284ad01f2f2a740ba

commit 22da09105d5cb37ea33c28f284ad01f2f2a740ba
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Wed Dec 11 18:10:15 2013 +0900

    evas gif loader - address animated always being true
    
    this addresses CID 1135790 and removes useless checks.
---
 src/modules/evas/loaders/gif/evas_image_load_gif.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/modules/evas/loaders/gif/evas_image_load_gif.c 
b/src/modules/evas/loaders/gif/evas_image_load_gif.c
index 44d379e..d767bd3 100644
--- a/src/modules/evas/loaders/gif/evas_image_load_gif.c
+++ b/src/modules/evas/loaders/gif/evas_image_load_gif.c
@@ -386,8 +386,6 @@ evas_image_load_file_head_gif2(void *loader_data,
    Frame_Info *finfo = NULL;
    Eina_Bool full = EINA_TRUE;
 
-   if (!loader) return EINA_FALSE;
-   
    // init prop struct with some default null values
    prop->w = 0;
    prop->h = 0;
@@ -551,8 +549,6 @@ evas_image_load_file_data_gif2(void *loader_data,
    int index = 0, imgnum = 0;
    Frame_Info *finfo;
 
-   if (!loader) return EINA_FALSE;
-   
    // XXX: this is so wrong - storing current frame IN the image
    // so we have to load multiple times to animate. what if the
    // same image is shared/loaded in 2 ore more places AND animated
@@ -608,7 +604,8 @@ open_file:
 
    // if we want to go backwards, we likely need/want to re-decode from the
    // start as we have nothnig to build on
-   if ((index > 0) && (index < loader->imgnum) && (loader->animated))
+   if ((index > 0) && (index < loader->imgnum) &&
+       (loader->animated->frame_count > 1))
      {
         if (loader->gif) DGifCloseFile(loader->gif);
         if ((loader->fi.map) && (loader->f))
@@ -766,8 +763,7 @@ open_file:
 
    // if we are at the end of the animation or not animated, close file
    loader->imgnum = imgnum;
-   if ((!loader->animated) ||
-       ((loader->animated) && (rec == TERMINATE_RECORD_TYPE)))
+   if ((animated->frame_count <= 1) || (rec == TERMINATE_RECORD_TYPE))
      {
         if (loader->gif) DGifCloseFile(loader->gif);
         if ((loader->fi.map) && (loader->f))

-- 


Reply via email to