]> git.street.me.uk Git - andy/viking.git/log
andy/viking.git
8 years agoMerge branch 'KMZ-Maps'
Rob Norris [Tue, 15 Dec 2015 00:04:32 +0000 (00:04 +0000)]
Merge branch 'KMZ-Maps'

8 years ago[DOC] KMZ Map help
Rob Norris [Sat, 21 Nov 2015 10:47:18 +0000 (10:47 +0000)]
[DOC] KMZ Map help

8 years agoKMZ file of OSM Mapnik rendering of Stonehenge area, zoom level 15.
Rob Norris [Fri, 20 Nov 2015 18:15:55 +0000 (18:15 +0000)]
KMZ file of OSM Mapnik rendering of Stonehenge area, zoom level 15.

8 years ago[WINDOWS] Installer and build notes for using libzip.dll
Rob Norris [Tue, 17 Nov 2015 20:33:44 +0000 (20:33 +0000)]
[WINDOWS] Installer and build notes for using libzip.dll

8 years agoAllow internal check_magic function to work on various lengths as specified.
Rob Norris [Sun, 8 Nov 2015 13:23:22 +0000 (13:23 +0000)]
Allow internal check_magic function to work on various lengths as specified.

8 years agoEnable importing a map from a KMZ file.
Rob Norris [Sun, 8 Nov 2015 12:41:48 +0000 (12:41 +0000)]
Enable importing a map from a KMZ file.

Uses libzip to decompress the KMZ and processes the XML description to
 generate a corresponding GeoRef layer.

8 years agoAllow creating GeoRef layers from a specified pixbuf and area.
Rob Norris [Sun, 8 Nov 2015 12:39:10 +0000 (12:39 +0000)]
Allow creating GeoRef layers from a specified pixbuf and area.

8 years agoMake the find best zoom level function reusable.
Rob Norris [Sun, 8 Nov 2015 12:35:16 +0000 (12:35 +0000)]
Make the find best zoom level function reusable.

8 years agoAdd utility function to write a temporary file from a byte buffer.
Rob Norris [Fri, 6 Nov 2015 16:16:02 +0000 (16:16 +0000)]
Add utility function to write a temporary file from a byte buffer.

8 years agoEnable KMZ Map file generation for Custom Map support on Garmin devices.
Rob Norris [Sun, 12 Jul 2015 15:23:10 +0000 (16:23 +0100)]
Enable KMZ Map file generation for Custom Map support on Garmin devices.

The KMZ is a zipped file containing a KML file with the associated image.

Use libzip to generate multiple files in a single zip file.

8 years agoFix routes not saved in GPX when tracks are made invisible.
Rob Norris [Fri, 4 Dec 2015 20:34:34 +0000 (20:34 +0000)]
Fix routes not saved in GPX when tracks are made invisible.

Probable copy and paste error in commit SHA:978cd6961f0cdfeb7d68fe18bc558011692cd7ce

8 years agoSF Bugs#103: Fix TrackWaypoint layer items may not be displayed when pasted
Rob Norris [Fri, 11 Dec 2015 17:44:48 +0000 (17:44 +0000)]
SF Bugs#103: Fix TrackWaypoint layer items may not be displayed when pasted

When the target window has a different View mode,
 then the coordinates must be converted to match to be shown in the viewport.
This is already done for single item pastes, but previously not for entire TRW layers.

8 years agoEnable Catalan and Turkish translations.
Rob Norris [Fri, 11 Dec 2015 01:03:17 +0000 (01:03 +0000)]
Enable Catalan and Turkish translations.

Seems these translations have been available for ages but not actually used.

8 years agoAuto generate the date for man pages.
Rob Norris [Thu, 10 Dec 2015 22:31:34 +0000 (22:31 +0000)]
Auto generate the date for man pages.

8 years agoRestore opening of JPG files.
Rob Norris [Wed, 9 Dec 2015 01:11:58 +0000 (01:11 +0000)]
Restore opening of JPG files.

More lenient string comparison for magic checking of JPG files,
 as the text returned seems to have changed.

8 years ago[QA] Tidy trw_layer_draw_point_names()
Rob Norris [Fri, 4 Dec 2015 20:31:24 +0000 (20:31 +0000)]
[QA] Tidy trw_layer_draw_point_names()

Remove unused variables and some minor whitespace improvements.

8 years agoSF Bugs#127: Fix initial display of Waypoint sort order.
Rob Norris [Mon, 7 Dec 2015 20:19:19 +0000 (20:19 +0000)]
SF Bugs#127: Fix initial display of Waypoint sort order.

Ensure sort is applied on realization of the TrackWaypoint layer,
 otherwise it may not be performed.

8 years agoFix map layer widget sensitivity dependent on map type.
Rob Norris [Fri, 27 Nov 2015 22:55:57 +0000 (22:55 +0000)]
Fix map layer widget sensitivity dependent on map type.

8 years agoMerge pull request #8 from swegener/etag-in-xattr
Rob Norris [Fri, 4 Dec 2015 00:06:56 +0000 (00:06 +0000)]
Merge pull request #8 from swegener/etag-in-xattr

Store etag in xattr

8 years agoMerge pull request #3 from Shura0/point_names
Rob Norris [Fri, 4 Dec 2015 00:05:29 +0000 (00:05 +0000)]
Merge pull request #3 from Shura0/point_names

Display trackpoint names

8 years agodownload: Move setting of etag and convert_file
Sven Wegener [Sun, 29 Nov 2015 20:15:13 +0000 (21:15 +0100)]
download: Move setting of etag and convert_file

It only makes sense to do this post-processing, if we got a new file, so
move the code just before the final rename.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
8 years agodownload: Store ETAG in extended attributes
Sven Wegener [Sat, 21 May 2011 17:56:46 +0000 (19:56 +0200)]
download: Store ETAG in extended attributes

If supported, store the etag values from downloaded tiles in extended
attributes on the local files, instead of cluttering our maps directory
with .etag files.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
8 years agoReleasing Viking 1.6.1
Rob Norris [Tue, 24 Nov 2015 22:24:58 +0000 (22:24 +0000)]
Releasing Viking 1.6.1

8 years agoShift the reference scale to be generated from the centre of the display.
Rob Norris [Sat, 21 Nov 2015 10:52:12 +0000 (10:52 +0000)]
Shift the reference scale to be generated from the centre of the display.

Previously this was done at the latitude of the bottom of the display.
For most zoomed in usage it makes no practical difference,
 but when zoomed out it's more logical as it's on average nearer to actual scale at locations across the visible map.

8 years agoUpdate viking.doap file
Rob Norris [Wed, 18 Nov 2015 01:21:37 +0000 (01:21 +0000)]
Update viking.doap file

8 years ago[DOC] Words about various operations from the File menu not previously mentioned.
Rob Norris [Tue, 17 Nov 2015 21:14:02 +0000 (21:14 +0000)]
[DOC] Words about various operations from the File menu not previously mentioned.

8 years agoEnsure calculation of the waypoint bounds even when the layer is not currently visible.
Rob Norris [Sun, 15 Nov 2015 11:30:11 +0000 (11:30 +0000)]
Ensure calculation of the waypoint bounds even when the layer is not currently visible.

8 years agoBetter reporting of failing to load any latlontz.txt file.
Rob Norris [Sat, 14 Nov 2015 13:15:10 +0000 (13:15 +0000)]
Better reporting of failing to load any latlontz.txt file.

8 years agoCID#34578: Remove logically dead code.
Rob Norris [Sat, 14 Nov 2015 12:55:44 +0000 (12:55 +0000)]
CID#34578: Remove logically dead code.

It's a repeat of the test above.
And explanation of when the test becomes true.

8 years agoCID#132266: Fix potential dereference null return value
Rob Norris [Sat, 14 Nov 2015 12:20:08 +0000 (12:20 +0000)]
CID#132266: Fix potential dereference null return value

8 years ago[QA] Clang-Analyzer: Don't store values that aren't subsequently used.
Rob Norris [Sat, 14 Nov 2015 11:59:15 +0000 (11:59 +0000)]
[QA] Clang-Analyzer: Don't store values that aren't subsequently used.

8 years ago[QA] Clang-Analyzer - remove duplicate line
Rob Norris [Sat, 14 Nov 2015 11:21:06 +0000 (11:21 +0000)]
[QA] Clang-Analyzer - remove duplicate line

8 years agoEnsure removing temporary file when it contains no wikipedia places.
Rob Norris [Sat, 14 Nov 2015 10:01:22 +0000 (10:01 +0000)]
Ensure removing temporary file when it contains no wikipedia places.

8 years ago[QA] Explicitly ignore return values when removing temporary generated files
Rob Norris [Sat, 14 Nov 2015 09:58:00 +0000 (09:58 +0000)]
[QA] Explicitly ignore return values when removing temporary generated files

8 years ago[QA] CID#34606+CID#34607: Time of check time of use (TOCTOU) issues.
Rob Norris [Sat, 14 Nov 2015 09:48:04 +0000 (09:48 +0000)]
[QA] CID#34606+CID#34607: Time of check time of use (TOCTOU) issues.

Mark as not security critical, use g_utime and check result.
Remove old GLIB version check as at least 2.26 must be used now.

8 years agoEnsure memory is freed if errors are encountered in acquiring My OSM traces
Rob Norris [Sat, 14 Nov 2015 09:43:30 +0000 (09:43 +0000)]
Ensure memory is freed if errors are encountered in acquiring My OSM traces

8 years agoCID#34579: Fix logically dead code.
Rob Norris [Fri, 13 Nov 2015 22:02:23 +0000 (22:02 +0000)]
CID#34579: Fix logically dead code.

This test is supposed to be for what the pointer is pointing to!

8 years agoCoverity: Prevent deference after null checks
Rob Norris [Fri, 13 Nov 2015 22:00:52 +0000 (22:00 +0000)]
Coverity: Prevent deference after null checks

CID#34580
CID#34582
CID#34588
CID#34589

8 years agoCID#34561+CID#34569: Check return values
Rob Norris [Fri, 13 Nov 2015 21:52:21 +0000 (21:52 +0000)]
CID#34561+CID#34569: Check return values

8 years agoCID#34586: Avoid potential explicit null deferenced
Rob Norris [Thu, 12 Nov 2015 22:45:49 +0000 (22:45 +0000)]
CID#34586: Avoid potential explicit null deferenced

8 years agoCID#34612: Fix incorrect break statement location.
Rob Norris [Thu, 12 Nov 2015 22:40:54 +0000 (22:40 +0000)]
CID#34612: Fix incorrect break statement location.

8 years agoCID#132255: Fix stray semicolon introduced by recent commit.
Rob Norris [Thu, 12 Nov 2015 22:39:29 +0000 (22:39 +0000)]
CID#132255: Fix stray semicolon introduced by recent commit.

Fix broken commit in SHA:5e4cce8f309867bee2f16bc463e0f0b461d19ecf

8 years agoCID#34592: Explicit handling of potential truncation of integer value
Rob Norris [Thu, 12 Nov 2015 22:36:50 +0000 (22:36 +0000)]
CID#34592: Explicit handling of potential truncation of integer value

8 years agoCoverity: Fix deference after null checks
Rob Norris [Thu, 12 Nov 2015 22:35:20 +0000 (22:35 +0000)]
Coverity: Fix deference after null checks

CID#34585
CID#34590
CID#34591

8 years agoCID#34600+CID#34601: Fix deference before null checks
Rob Norris [Thu, 12 Nov 2015 22:33:38 +0000 (22:33 +0000)]
CID#34600+CID#34601: Fix deference before null checks

8 years ago[QA] CID#34594: Remove unsigned compared against 0 (as it has no effect)
Rob Norris [Thu, 12 Nov 2015 22:31:03 +0000 (22:31 +0000)]
[QA] CID#34594: Remove unsigned compared against 0 (as it has no effect)

8 years agoDocument previous translation updates
Rob Norris [Tue, 10 Nov 2015 21:05:25 +0000 (21:05 +0000)]
Document previous translation updates

8 years agoImport Launchpad translation updates
Rob Norris [Tue, 10 Nov 2015 21:03:53 +0000 (21:03 +0000)]
Import Launchpad translation updates

8 years agoInclude HACKING file in distribution.
Rob Norris [Tue, 10 Nov 2015 20:56:41 +0000 (20:56 +0000)]
Include HACKING file in distribution.

8 years agoFix Georef mpp from coords.
Rob Norris [Fri, 6 Nov 2015 16:25:49 +0000 (16:25 +0000)]
Fix Georef mpp from coords.

Conversion from the image mpp to Viking zoom level is dependent on the latitude when in LATLON mode.

8 years agoMake OSM services the default by including these modules first.
Rob Norris [Thu, 5 Nov 2015 17:56:39 +0000 (17:56 +0000)]
Make OSM services the default by including these modules first.

8 years agoSimplify filter actually uses the unsigned integer value.
Rob Norris [Thu, 5 Nov 2015 17:52:18 +0000 (17:52 +0000)]
Simplify filter actually uses the unsigned integer value.

8 years agoFix Google maps positional web link.
Rob Norris [Sun, 8 Nov 2015 12:07:46 +0000 (12:07 +0000)]
Fix Google maps positional web link.

Format seems to have changed recently.

8 years ago[QA] Fix issue spotted with cppcheck 1.70
Rob Norris [Sun, 8 Nov 2015 12:18:12 +0000 (12:18 +0000)]
[QA] Fix issue spotted with cppcheck 1.70

8 years agoRemove unused northernHemisphere variable
Rob Norris [Sun, 8 Nov 2015 12:04:44 +0000 (12:04 +0000)]
Remove unused northernHemisphere variable

8 years ago[QA] Output console message if g_mkdir_with_parents() is unsuccessful.
Rob Norris [Fri, 6 Nov 2015 16:39:22 +0000 (16:39 +0000)]
[QA] Output console message if g_mkdir_with_parents() is unsuccessful.

8 years agoCID#34603: Protection in copying into fixed size buffer
Rob Norris [Sun, 8 Nov 2015 13:20:01 +0000 (13:20 +0000)]
CID#34603: Protection in copying into fixed size buffer

8 years agoCID#34584+CID#34583: Prevent deference after null check
Rob Norris [Fri, 6 Nov 2015 14:56:25 +0000 (14:56 +0000)]
CID#34584+CID#34583: Prevent deference after null check

8 years agoCID#34611+CID#34611: Prevent use of uninitialized scalar variables
Rob Norris [Fri, 6 Nov 2015 08:46:29 +0000 (08:46 +0000)]
CID#34611+CID#34611: Prevent use of uninitialized scalar variables

Handle potentially unknown horiz_units, although this shouldn't normally happen

8 years ago[QA] CID#34576: Remove logically dead code
Rob Norris [Thu, 5 Nov 2015 19:56:48 +0000 (19:56 +0000)]
[QA] CID#34576: Remove logically dead code

8 years ago[QA] CID#34575: Remove logically dead code.
Rob Norris [Thu, 5 Nov 2015 19:35:18 +0000 (19:35 +0000)]
[QA] CID#34575: Remove logically dead code.

Items are always considered for rename when moved.
The unique name can be straight copy of the original.

8 years ago[QA] CID#34543: Adjust curl_get_etag_func to use pointer to structure rather than...
Rob Norris [Thu, 5 Nov 2015 19:18:48 +0000 (19:18 +0000)]
[QA] CID#34543: Adjust curl_get_etag_func to use pointer to structure rather than the raw address.

8 years agoCID#131392: Avoid potential null pointer dereference
Rob Norris [Wed, 4 Nov 2015 22:16:23 +0000 (22:16 +0000)]
CID#131392: Avoid potential null pointer dereference

8 years agoCID#34574: Fix freeing the appropriate variable.
Rob Norris [Wed, 4 Nov 2015 22:03:46 +0000 (22:03 +0000)]
CID#34574: Fix freeing the appropriate variable.

8 years ago[QA] Generally print warnings to the console for low level file operations
Rob Norris [Wed, 4 Nov 2015 22:01:49 +0000 (22:01 +0000)]
[QA] Generally print warnings to the console for low level file operations
(since they don't normally go wrong)

CID#34548
CID#34549
CID#34550
CID#34552
CID#34558
CID#34560
CID#34562
CID#34564
CID#34568
CID#34569
CID#34571
CID#34572
CID#34573

8 years ago[QA] CID#34547: Path value is checked so not worried about function return value.
Rob Norris [Wed, 4 Nov 2015 20:59:36 +0000 (20:59 +0000)]
[QA] CID#34547: Path value is checked so not worried about function return value.

8 years ago[QA] Coverity: Unchecked return value from library
Rob Norris [Wed, 4 Nov 2015 20:56:59 +0000 (20:56 +0000)]
[QA] Coverity: Unchecked return value from library

Explicitly ignore return values - when removing temporary generate files

CID#131383
CID#131382
CID#131381
CID#34570
CID#34563
CID#34561
CID#34557
CID#34555
CID#34546

8 years agoFix track tooltips minutes value should be rounded.
Rob Norris [Tue, 3 Nov 2015 08:19:37 +0000 (08:19 +0000)]
Fix track tooltips minutes value should be rounded.

Thus need to ensure in floating point otherwise the minutes value gets truncated.

8 years agoCID#101113: Result not floating point
Rob Norris [Tue, 3 Nov 2015 08:17:01 +0000 (08:17 +0000)]
CID#101113: Result not floating point

Minutes value should be rounded, thus need to pass in as floating point.

8 years ago[QA] CID#101114+CID#101115: Result not floating point
Rob Norris [Tue, 3 Nov 2015 08:11:08 +0000 (08:11 +0000)]
[QA] CID#101114+CID#101115: Result not floating point

No need for round since the truncated integer division value is needed for the hours value.

8 years ago[QA] CID#131384: Check function return value.
Rob Norris [Tue, 3 Nov 2015 07:45:22 +0000 (07:45 +0000)]
[QA] CID#131384: Check function return value.

8 years ago[QA] CID#131386: Check function result
Rob Norris [Tue, 3 Nov 2015 07:35:37 +0000 (07:35 +0000)]
[QA] CID#131386: Check function result

8 years ago[QA] CID#131385+CID#131387: Be more explicit that we don't care about the result...
Rob Norris [Tue, 3 Nov 2015 07:32:17 +0000 (07:32 +0000)]
[QA] CID#131385+CID#131387: Be more explicit that we don't care about the result of this function call.

8 years ago[QA] CID#131393: Missing break in switch
Rob Norris [Mon, 2 Nov 2015 21:55:53 +0000 (21:55 +0000)]
[QA] CID#131393: Missing break in switch

8 years ago[QA] CID#131394: Check result of g_fopen()
Rob Norris [Mon, 2 Nov 2015 21:54:34 +0000 (21:54 +0000)]
[QA] CID#131394: Check result of g_fopen()

Add warnings if the LatLonTZ file can not be accessed or opened.

8 years ago[QA] CID#131401+CID131400 - Improve printf arg types.
Rob Norris [Mon, 2 Nov 2015 21:49:42 +0000 (21:49 +0000)]
[QA] CID#131401+CID131400 - Improve printf arg types.

8 years ago[QA] CID#131402: Fix resource leak in handling metatile errors.
Rob Norris [Mon, 2 Nov 2015 21:46:07 +0000 (21:46 +0000)]
[QA] CID#131402: Fix resource leak in handling metatile errors.

8 years agoFix creating waypoints from JPGs when using gexiv2
Rob Norris [Mon, 2 Nov 2015 21:43:10 +0000 (21:43 +0000)]
Fix creating waypoints from JPGs when using gexiv2

8 years agoSF Bugs#126: Fix crash in gdk_rgb_convert_0888 due to using deallocated memory.
Szymon Bigos [Fri, 25 Sep 2015 19:30:39 +0000 (20:30 +0100)]
SF Bugs#126: Fix crash in gdk_rgb_convert_0888 due to using deallocated memory.

There is reference counter in cached pixel buffers.
Previously it always equalled one although multiple tasks could be using it.
Thus when the cache is flushed, memory was always deallocated but then another task would attempt to use it and crash.

Thus now the cached pixel buffer is tracked properly with unref() after being used,
 so only when reference count is zero it is automatically deallocated.

Signed-off-by: Rob Norris <rw_norris@hotmail.com>
8 years agoDisable Search and Routing with Google as they no longer support the APIs Viking...
Rob Norris [Fri, 25 Sep 2015 19:29:15 +0000 (20:29 +0100)]
Disable Search and Routing with Google as they no longer support the APIs Viking used.

The only supported file formats seem to be JSON and XML in their own custom schemas (and not currently supported by GPSBabel).
Also now you need to supply an application key for all Google APIs.

8 years agoFix availability of Geotag consistency checks when using gexiv2
Rob Norris [Thu, 24 Sep 2015 18:44:14 +0000 (19:44 +0100)]
Fix availability of Geotag consistency checks when using gexiv2

8 years agoRemove --with-search configure options since they are not used.
Rob Norris [Thu, 24 Sep 2015 18:42:43 +0000 (19:42 +0100)]
Remove --with-search configure options since they are not used.

They haven't been used since the search location web service engine was made selectable at run time back in 2010.

9 years agoImprove place search failure message to say if it is a service level issue.
Rob Norris [Tue, 22 Sep 2015 20:53:38 +0000 (21:53 +0100)]
Improve place search failure message to say if it is a service level issue.

Expand vik_goto_tool_get_coord() to flow up if there is an error communicating with the web search provider.

9 years agoProtect against possible out of bounds array access.
Rob Norris [Mon, 21 Sep 2015 22:22:47 +0000 (23:22 +0100)]
Protect against possible out of bounds array access.

9 years ago[QA] Coverity 'Uninitialized pointer read' CID#34608 + CID#34609.
Rob Norris [Tue, 15 Sep 2015 21:34:09 +0000 (22:34 +0100)]
[QA] Coverity 'Uninitialized pointer read' CID#34608 + CID#34609.

Force initialise to NULL values, even if these variables get assigned from the function calls.

9 years ago[QA] Coverity 'Buffer not null terminated' issues CID#34544 + CID#34545
Rob Norris [Tue, 15 Sep 2015 21:30:31 +0000 (22:30 +0100)]
[QA] Coverity 'Buffer not null terminated' issues CID#34544 + CID#34545

Switch to use a function that ensures the buffer is null terminated.

Note that in these cases it is using a time format string that would always be less than the buffer size anyway.

9 years agoFix DEM height points on track graphs when height units is in feet and non-zero minim...
Rob Norris [Wed, 2 Sep 2015 22:03:01 +0000 (23:03 +0100)]
Fix DEM height points on track graphs when height units is in feet and non-zero minimum height.

Offset is already in the current height units,
 so elevation value should be adjusted *after* it is in the appropriate units.

9 years ago[DOC] Improved introduction.
Rob Norris [Sun, 12 Jul 2015 15:21:52 +0000 (16:21 +0100)]
[DOC] Improved introduction.

9 years agoOnly perform man page generation when scrollkeeper is also installed.
Rob Norris [Sat, 12 Sep 2015 11:22:47 +0000 (12:22 +0100)]
Only perform man page generation when scrollkeeper is also installed.

9 years ago[QA] Remove repeated statements in configure.ac
Rob Norris [Sat, 12 Sep 2015 11:14:45 +0000 (12:14 +0100)]
[QA] Remove repeated statements in configure.ac

9 years agoFix mapnik preferences initialisation to not crash if preferences are not available.
Rob Norris [Sat, 12 Sep 2015 10:56:41 +0000 (11:56 +0100)]
Fix mapnik preferences initialisation to not crash if preferences are not available.

9 years agoEnable reference documentation generation by disabling optional components.
Rob Norris [Sat, 12 Sep 2015 10:23:45 +0000 (11:23 +0100)]
Enable reference documentation generation by disabling optional components.

Otherwise at the linking stage of the scan program, it tries to find terraserver related objects;
 which are no longer in the default build.

9 years agoReactivate doc subtree
Guilhem Bonnefille [Wed, 2 Sep 2015 21:26:47 +0000 (23:26 +0200)]
Reactivate doc subtree

Previously, in order to build the reference documentation only when needed
(read: only some maintainers and only when they want) a solution was created
to deactivate processing of the whole doc subtree. But the side effect was to
not deliver at all the doc subtree if the correct options are not activated.
With an incomplete delivery, some tools like autoreconf (used by packaging
utilities) fail, bringing packager to patch and patch again the sources.

With this change, the doc subtree is no more ignored and the reference
documentation is processed ony when the corresponding ./configure flags is
activated.

9 years agoEnsure thumbnails are created when opening JPG files.
Rob Norris [Sun, 12 Jul 2015 14:15:12 +0000 (15:15 +0100)]
Ensure thumbnails are created when opening JPG files.

9 years agoInsert parameter for Viking's version in viking.xml
Guilhem Bonnefille [Wed, 2 Sep 2015 20:27:30 +0000 (22:27 +0200)]
Insert parameter for Viking's version in viking.xml

Insertion is done by configure, so the file is renamed as viking.xml.in.
The most annoying with this change is probably to configure the XML editor
to handle xml.in files.

9 years agoFix 2 heap-buffer-overflows in trw_layer_download_map_along_track_cb()
Roman Lebedev [Fri, 28 Aug 2015 15:44:18 +0000 (18:44 +0300)]
Fix 2 heap-buffer-overflows in trw_layer_download_map_along_track_cb()

1 byte is less than sizeof(gpointer), so we do not have enough memory
for last NULL pointer.

This could be solved by braces, but since glib provides g_malloc_n(),
and this kind of bug can be avoided with it, so.

Signed-off-by: Rob Norris <rw_norris@hotmail.com>
9 years agoFix heap-buffer-overflow on Layers -> New GPS Layer
Roman Lebedev [Fri, 28 Aug 2015 15:19:16 +0000 (18:19 +0300)]
Fix heap-buffer-overflow on Layers -> New GPS Layer

Very typical issue, unfortunately, missing braces and we are
corrupting memory. It is better to use g_malloc_n() to avoid this.

Fixes following AddressSanitizer error:
==17766==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60b0008db6a0 at pc 0x00000048ba9e bp 0x7ffcf3e532a0 sp 0x7ffcf3e53298
WRITE of size 8 at 0x60b0008db6a0 thread T0
    0 0x48ba9d in gps_layer_inst_init /home/lebedevri/src/viking/src/vikgpslayer.c:386
    1 0x7fa95d549f98 in g_type_create_instance (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x31f98)
    2 0x7fa95d52d866  (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x15866)
    3 0x7fa95d52f25c in g_object_newv (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x1725c)
    4 0x7fa95d52f9f3 in g_object_new (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x179f3)
    5 0x48dca7 in vik_gps_layer_new /home/lebedevri/src/viking/src/vikgpslayer.c:659
    6 0x48e1f0 in vik_gps_layer_create /home/lebedevri/src/viking/src/vikgpslayer.c:419
    7 0x45d119 in vik_layer_create /home/lebedevri/src/viking/src/viklayer.c:229
    8 0x460463 in vik_layers_panel_new_layer /home/lebedevri/src/viking/src/viklayerspanel.c:461
    9 0x46982e in menu_addlayer_cb /home/lebedevri/src/viking/src/vikwindow.c:2411
    10 0x7fa95d5282d4 in g_closure_invoke (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x102d4)
    11 0x7fa95d53a03b  (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2203b)
    12 0x7fa95d542697 in g_signal_emit_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2a697)
    13 0x7fa95d5428fe in g_signal_emit (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2a8fe)
    14 0x7fa95f0ec8cf  (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x748cf)
    15 0x7fa95d528503  (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x10503)
    16 0x7fa95d541fa6 in g_signal_emit_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x29fa6)
    17 0x7fa95d5428fe in g_signal_emit (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2a8fe)
    18 0x7fa95f2c0c55 in gtk_widget_activate (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x248c55)
    19 0x7fa95f1bc98c in gtk_menu_shell_activate_item (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x14498c)
    20 0x7fa95f1bcd2a  (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x144d2a)
    21 0x7fa95f1aaa7e  (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x132a7e)
    22 0x7fa95d5282d4 in g_closure_invoke (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x102d4)
    23 0x7fa95d539f31  (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x21f31)
    24 0x7fa95d5421a4 in g_signal_emit_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2a1a4)
    25 0x7fa95d5428fe in g_signal_emit (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x2a8fe)
    26 0x7fa95f2c1ecb  (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x249ecb)
    27 0x7fa95f1a91c3 in gtk_propagate_event (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x1311c3)
    28 0x7fa95f1a965a in gtk_main_do_event (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x13165a)
    29 0x7fa95ee1abbb  (/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0+0x5abbb)
    30 0x7fa95d251c3c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x49c3c)
    31 0x7fa95d251f1f  (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x49f1f)
    32 0x7fa95d252241 in g_main_loop_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a241)
    33 0x7fa95f1a85d6 in gtk_main (/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0+0x1305d6)
    34 0x41829c in main /home/lebedevri/src/viking/src/main.c:259
    35 0x7fa959a69b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    36 0x417b78  (/home/lebedevri/src/viking/src/viking+0x417b78)

0x60b0008db6a1 is located 0 bytes to the right of 97-byte region [0x60b0008db640,0x60b0008db6a1)
allocated by thread T0 here:
    0 0x7fa95f96437a in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9437a)
    1 0x7fa95d257799 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f799)
    2 0x7fa95d549f98 in g_type_create_instance (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x31f98)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/lebedevri/src/viking/src/vikgpslayer.c:386 gps_layer_inst_init
Shadow bytes around the buggy address:
..
  0x0c16801136c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x0c16801136d0: 00 00 00 00[01]fa fa fa fa fa fa fa fa fa 00 00
..
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
==17766==ABORTING

Signed-off-by: Rob Norris <rw_norris@hotmail.com>
9 years agoSF Bugs#121: Additional race condition crash protection.
Rob Norris [Mon, 31 Aug 2015 21:55:13 +0000 (22:55 +0100)]
SF Bugs#121: Additional race condition crash protection.

Subsequent code where variables could point to invalid locations.

Note this is called manually, so much less likely to encounter the race condition.

9 years agoSF Bugs#121: Fix crash when invalidating previously acquired tiles.
Szymon Bigos [Mon, 31 Aug 2015 21:39:17 +0000 (22:39 +0100)]
SF Bugs#121: Fix crash when invalidating previously acquired tiles.

This race condition can most often be triggered by zooming in/out rapidly.

The fault is due to using accessing variables outside of the lock section of the memory cache.
This has been in the code since the initial lock adding commit [in 2008]
 (SHA:9b79169dba7cd4df6badebdda23a370064ebfafd)

Signed-off-by: Rob Norris <rw_norris@hotmail.com>
9 years agoQA: extract effective code from g_assert
Guilhem Bonnefille [Sun, 30 Aug 2015 21:05:00 +0000 (23:05 +0200)]
QA: extract effective code from g_assert

Typos spotted by coverity: https://scan.coverity.com/projects/viking