]> git.street.me.uk Git - andy/viking.git/commitdiff
[Geotagging] Fix SF#3564795: Crashing when attempting to create waypoints from EXIF...
authorRob Norris <rw_norris@hotmail.com>
Wed, 5 Sep 2012 00:15:30 +0000 (01:15 +0100)
committerRob Norris <rw_norris@hotmail.com>
Thu, 6 Sep 2012 20:56:56 +0000 (21:56 +0100)
Don't try and use the returned NULL waypoint!

src/viktrwlayer_geotag.c

index 60718fce008c2209fff2529e79687bc7e72e7294..5be6178c7fddc60424501a2344ac3ec096f0e07b 100644 (file)
@@ -256,6 +256,11 @@ static void trw_layer_geotag_process ( geotag_options_t *options )
                                // Create waypoint with file information
                                gchar *name = NULL;
                                VikWaypoint *wp = a_geotag_create_waypoint_from_file ( options->image, vik_trw_layer_get_coord_mode (options->vtl), &name );
+                               if ( !wp ) {
+                                       // Couldn't create Waypoint
+                                       g_free ( datetime );
+                                       return;
+                               }
                                if ( !name )
                                        name = g_strdup ( a_file_basename ( options->image ) );