投稿者 トピック: [r5676]calc_severity_colorのオーバーフロー  (参照数 2536 回)

z9999+

  • 管理人
  • 急行
  • *
  • 投稿: 381
minimapで電力の需要が供給を超えた場合、高圧線の色が正しくない。

severity_color[MAX_SEVERITY_COLORS] is out of range.
This overflow will be caused in MAP_POWERLINES mode when demand is outstripping supply.



kerte.cc:458
引用
      return reliefkarte_t::severity_color[ clamp( severity, 0, MAX_SEVERITY_COLORS ) ];
↓ should be
引用
      return reliefkarte_t::severity_color[ clamp( severity, 0, MAX_SEVERITY_COLORS-1 ) ];

prissi

  • 各駅停車
  • *
  • 投稿: 45
Re:[r5676]calc_severity_colorのオーバーフロー
« 返信 #1 on: 2012/05/04 05:14 »
Thank, I really did not think correctly, when adding the clamp there ...