Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #707912

Mapimg crash with high number of players

Added by Marko Lindqvist about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

img_save_magickwand() crashed to division by zero.

First, in line 2152 (in master) assigns zero to plrwidth (map_width = 387, player_slot_count() = 512, integer math):
plrwidth = map_width / player_slot_count();

Then, at line 2165 there's division by plrwidth:
i = (x - plroffset) / plrwidth;

mapimg_bugfix.patch (579 Bytes) mapimg_bugfix.patch Andreas Røsdal, 2017-12-17 07:18 AM

History

#1 Updated by Andreas Røsdal about 3 years ago

Patch attached.

#2 Updated by Marko Lindqvist about 3 years ago

  • Sprint/Milestone set to 3.1.0

#3 Updated by Marko Lindqvist about 3 years ago

Have you checked that the negative plroffset value, that is possible with the patch, is not a problem?

#4 Updated by Andreas Røsdal about 3 years ago

No, not checked that.

#5 Updated by Chad McHenry about 2 years ago

A pull request to address this has been submitted to Github: https://github.com/freeciv/freeciv/pull/14

#6 Updated by Marko Lindqvist about 2 years ago

  • Status changed from In Progress to Resolved
  • Assignee deleted (Andreas Røsdal)
  • Sprint/Milestone changed from 3.1.0 to 2.6.1

While the problem is more likely to occur in master where max number of players (barbarians included) is 512, it can happen in older branches with smaller displays -> retargeting to S2_6.

#7 Updated by Marko Lindqvist about 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF