[libchamplain] Get rid of some warnings in ChamplainImageRenderer



commit 1acc385842058a2d9845a61a80706b827e53526a
Author: JiÅ?í Techet <techet gmail com>
Date:   Sun Aug 15 01:03:00 2010 +0200

    Get rid of some warnings in ChamplainImageRenderer
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-image-renderer.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-image-renderer.c b/champlain/champlain-image-renderer.c
index 82208cf..e301f99 100644
--- a/champlain/champlain-image-renderer.c
+++ b/champlain/champlain-image-renderer.c
@@ -114,6 +114,9 @@ render (ChamplainRenderer *renderer, ChamplainTile *tile)
 
   callback_data.error = FALSE;
 
+  if (!priv->data || priv->size == 0)
+    goto error;
+    
   loader = gdk_pixbuf_loader_new ();
   if (!gdk_pixbuf_loader_write (loader,
           (const guchar *) priv->data,
@@ -126,7 +129,6 @@ render (ChamplainRenderer *renderer, ChamplainTile *tile)
           g_error_free (error);
         }
 
-      goto error;
     }
 
   gdk_pixbuf_loader_close (loader, &error);
@@ -170,7 +172,8 @@ finish:
   callback_data.data = priv->data;
   callback_data.size = priv->size;
 
-  champlain_tile_set_content (tile, actor);
+  if (actor)
+    champlain_tile_set_content (tile, actor);
 
   g_signal_emit_by_name (tile, "render-complete", &callback_data);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]