Bug 881018 - Crash when TiledLayerBuffer::GetScaledTileLength returns 0; r=cwiiis

This commit is contained in:
Jim Chen 2013-07-24 11:17:49 -04:00
parent eb22575f8c
commit c16d2bf628

View File

@ -111,7 +111,16 @@ public:
bool RemoveTile(int x, int y, Tile& aRemovedTile);
uint16_t GetTileLength() const { return TILEDLAYERBUFFER_TILE_SIZE; }
uint32_t GetScaledTileLength() const { return TILEDLAYERBUFFER_TILE_SIZE / mResolution; }
uint32_t GetScaledTileLength() const {
// volatile variables to help investigate bug 881018
volatile float resolution = mResolution;
volatile float fScaledLength = TILEDLAYERBUFFER_TILE_SIZE / mResolution;
volatile uint32_t uiScaledLength = TILEDLAYERBUFFER_TILE_SIZE / mResolution;
if (!uiScaledLength) {
MOZ_CRASH();
}
return uiScaledLength;
}
unsigned int GetTileCount() const { return mRetainedTiles.Length(); }