Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] fix infinite loop in mbgl::resample
Browse files Browse the repository at this point in the history
fix #4416
  • Loading branch information
ansis committed Mar 29, 2016
1 parent 3cc55a9 commit a22984b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mbgl/renderer/symbol_bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SymbolBucket::SymbolBucket(uint32_t overscaling_, float zoom_, const MapMode mod
: overscaling(overscaling_),
zoom(zoom_),
tileSize(util::tileSize * overscaling_),
tilePixelRatio(util::EXTENT / tileSize),
tilePixelRatio(float(util::EXTENT) / tileSize),
mode(mode_) {}

SymbolBucket::~SymbolBucket() {
Expand Down
3 changes: 3 additions & 0 deletions src/mbgl/text/get_anchors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <mbgl/util/constants.hpp>
#include <mbgl/util/interpolate.hpp>

#include <cassert>
#include <cmath>

namespace mbgl {
Expand All @@ -21,6 +22,8 @@ Anchors resample(const GeometryCoordinates &line, const float offset, const floa

Anchors anchors;

assert(spacing > 0.0);

int i = 0;
for (auto it = line.begin(), end = line.end() - 1; it != end; it++, i++) {
const GeometryCoordinate &a = *(it);
Expand Down

0 comments on commit a22984b

Please sign in to comment.