Skip to content

Commit af3554f

Browse files
chetnieterkwrobot
authored andcommitted
Merge topic 'dev/gdal-image-io-null-md'
017285e Prevent segfault when saving image with null metadata Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !194
2 parents 6c3f0e0 + 017285e commit af3554f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

arrows/gdal/image_io.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ ::save_( const std::string& filename, vital::image_container_sptr data ) const
252252
}
253253
}
254254

255-
if( auto const& corners_entry =
256-
metadata->find( vital::VITAL_META_CORNER_POINTS ) )
255+
vital::metadata_item corners_entry{ vital::VITAL_META_UNKNOWN, 0 };
256+
if( metadata &&
257+
( corners_entry = metadata->find( vital::VITAL_META_CORNER_POINTS ) ) )
257258
{
258259
auto const points =
259260
corners_entry

doc/release-notes/master.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Updates
66

77
Bug Fixes
88
---------
9+
10+
Arrows: GDAL
11+
12+
* Prevented segfault when saving image with null metadata.

0 commit comments

Comments
 (0)