[oe-commits] Klaus Kurzmann : tangogps: add patch for zoom segfault
git version control
git at git.openembedded.org
Fri Oct 2 20:45:20 UTC 2009
Module: openembedded.git
Branch: shr/import
Commit: cf83ab7be45abb7658fe0b458a535b2b1f49abd0
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=cf83ab7be45abb7658fe0b458a535b2b1f49abd0
Author: Klaus Kurzmann <mok at fluxnetz.de>
Date: Fri Oct 2 22:45:19 2009 +0200
tangogps: add patch for zoom segfault
Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>
---
.../tangogps/tangogps-0.9.7/maptile-zoom-fix.patch | 76 ++++++++++++++++++++
recipes/tangogps/tangogps_0.9.7.bb | 3 +-
2 files changed, 78 insertions(+), 1 deletions(-)
diff --git a/recipes/tangogps/tangogps-0.9.7/maptile-zoom-fix.patch b/recipes/tangogps/tangogps-0.9.7/maptile-zoom-fix.patch
new file mode 100644
index 0000000..ae249bb
--- /dev/null
+++ b/recipes/tangogps/tangogps-0.9.7/maptile-zoom-fix.patch
@@ -0,0 +1,76 @@
+=== modified file 'src/map_management.c'
+--- src/map_management.c 2009-09-26 02:35:15 +0000
++++ src/map_management.c 2009-10-02 02:40:39 +0000
+@@ -19,8 +19,6 @@
+ #include "wp.h"
+
+
+-static GdkPixbuf *pixbuf = NULL;
+-static GdkPixbuf *pixbuf_scaled = NULL;
+ static GError *error = NULL;
+ static GdkGC *gc_map = NULL;
+
+@@ -42,6 +40,8 @@ load_tile( gchar *dir,
+ gboolean tile_found = FALSE;
+ repo_t *repo;
+ static gchar filename[256];
++
++ GdkPixbuf *pixbuf = NULL;
+
+
+ printf("* load tile()\n");
+@@ -55,15 +55,6 @@ load_tile( gchar *dir,
+ }
+ else printf("no drawable -> NULL\n");
+
+-
+-
+- if (pixbuf)
+- g_object_unref (pixbuf);
+-
+- if (pixbuf_scaled)
+- g_object_unref (pixbuf_scaled);
+-
+-
+
+ for(overzoom=0; overzoom<=3; overzoom++)
+ {
+@@ -83,6 +74,8 @@ load_tile( gchar *dir,
+
+ if(pixbuf && overzoom)
+ {
++ GdkPixbuf *pixbuf_scaled = NULL;
++
+
+ pixbuf_scaled = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 256, 256);
+
+@@ -92,6 +85,13 @@ load_tile( gchar *dir,
+ -TILESIZE*(x%upscale), -TILESIZE*(y%upscale),
+ upscale, upscale,
+ GDK_INTERP_BILINEAR );
++
++ if (pixbuf)
++ {
++ g_object_unref (pixbuf);
++ }
++
++ pixbuf = pixbuf_scaled;
+ }
+
+ if(!tile_found)
+@@ -129,12 +129,13 @@ load_tile( gchar *dir,
+ gdk_draw_pixbuf (
+ pixmap,
+ gc_map,
+- (overzoom ? pixbuf_scaled : pixbuf),
++ pixbuf,
+ 0,0,
+ offset_x,offset_y,
+ TILESIZE,TILESIZE,
+ GDK_RGB_DITHER_NONE, 0, 0);
+
++ g_object_unref (pixbuf);
+ }
+
+
+
diff --git a/recipes/tangogps/tangogps_0.9.7.bb b/recipes/tangogps/tangogps_0.9.7.bb
index c83ecd0..815b4ce 100644
--- a/recipes/tangogps/tangogps_0.9.7.bb
+++ b/recipes/tangogps/tangogps_0.9.7.bb
@@ -1,3 +1,4 @@
require tangogps.inc
-PR = "r1"
+PR = "r2"
+SRC_URI_append = "file://maptile-zoom-fix.patch;patch=1"
More information about the Openembedded-commits
mailing list