URL:
  <http://gna.org/bugs/?21467>

                 Summary: end iterator deref when launching test scenario
                 Project: Battle for Wesnoth
            Submitted by: anonymissimus
            Submitted on: Sa 11 Jan 2014 00:27:18 GMT
                Category: Bug
                Severity: 4 - Important
                Priority: 7 - High
              Item Group:  None of the others
                  Status: None
                 Privacy: Public
             Assigned to: fendrin
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: trunk@6a531db9dc958cbdf816d2a1dfe77e8cee
        Operating System: all

    _______________________________________________________

Details:

see workaround:
++
diff --git a/src/minimap.cpp b/src/minimap.cpp
index e2d6e69..fa6c0b6 100644
--- a/src/minimap.cpp
+++ b/src/minimap.cpp
@@ -165,7 +165,8 @@ surface getMinimap(int w, int h, const gamemap &map, const
team *vw, const std::
 
                                } else {
 
-                                       SDL_Color normal_col =
int_to_color(game_config::team_rgb_range.find(terrain_info.id())->second.rep());
+                                       std::map<std::string, 
color_range>::const_iterator it =
game_config::team_rgb_range.find(terrain_info.id());
+                                       SDL_Color normal_col = int_to_color(it 
==
game_config::team_rgb_range.end() ? 0 : it->second.rep());
 
                                        SDL_Color col = normal_col;
                                        bool first = true;
@@ -173,7 +174,8 @@ surface getMinimap(int w, int h, const gamemap &map, const
team *vw, const std::
                                        BOOST_FOREACH(const 
t_translation::t_terrain& underlying_terrain,
underlying_terrains) {
 
                                                const std::string& terrain_id =
map.get_terrain_info(underlying_terrain).id();
-                                               SDL_Color tmp =
int_to_color(game_config::team_rgb_range.find(terrain_id)->second.rep());
+                                               std::map<std::string, 
color_range>::const_iterator it =
game_config::team_rgb_range.find(terrain_id);
+                                               SDL_Color tmp = int_to_color(it 
== game_config::team_rgb_range.end() ?
0 : it->second.rep());
 
                                                if (fogged) {
                                                        if (tmp.b < 50) tmp.b = 
0;
--




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21467>

_______________________________________________
  Nachricht gesendet von/durch Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
Wesnoth-bugs@gna.org
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to