Skip to content

Commit

Permalink
fix segfault in map image exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
garakmon committed Jun 23, 2023
1 parent 3d9eb44 commit e7ac71a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ui/mapimageexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@ void MapImageExporter::saveImage() {
progress.setMaximum(1);
progress.setValue(0);

int maxWidth = this->map->getWidth() * 16;
int maxHeight = this->map->getHeight() * 16;
Layout *layout = this->map->layout;
if (!layout) break;

int maxWidth = layout->getWidth() * 16;
int maxHeight = layout->getHeight() * 16;
if (showBorder) {
maxWidth += 2 * STITCH_MODE_BORDER_DISTANCE * 16;
maxHeight += 2 * STITCH_MODE_BORDER_DISTANCE * 16;
Expand Down

0 comments on commit e7ac71a

Please sign in to comment.