Kaydet (Commit) 06458fde authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1251583 Division or modulo by zero

Change-Id: Ib3cb04305a39d652b188d8cff1d63f85074427a0
üst 0e066f4e
......@@ -199,15 +199,15 @@ bool OpenGLSalBitmap::AllocateUserData()
}
bool alloc = false;
if (mnBytesPerRow != 0
&& mnBytesPerRow <= std::numeric_limits<sal_uInt32>::max() / mnHeight)
if (mnBytesPerRow != 0 && mnHeight &&
mnBytesPerRow <= std::numeric_limits<sal_uInt32>::max() / mnHeight)
{
try
{
maUserBuffer.reset( new sal_uInt8[mnBytesPerRow * mnHeight] );
alloc = true;
}
catch (std::bad_alloc &) {}
catch (const std::bad_alloc &) {}
}
if (!alloc)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment