Bug 1318007: When the surface is already allocated, just check for non-positive dimensions. r=aosmond

MozReview-Commit-ID: C0Fkq1SVO3s

--HG--
extra : rebase_source : 9b927993272338b811c49746d64077fc265cbb85
This commit is contained in:
Milan Sreckovic 2016-11-21 12:48:40 -05:00
Родитель 9c80f7b6f2
Коммит 4f7e0ff668
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -770,7 +770,10 @@ Factory::CreateWrappingDataSourceSurface(uint8_t *aData,
SourceSurfaceDeallocator aDeallocator /* = nullptr */,
void* aClosure /* = nullptr */)
{
if (!AllowedSurfaceSize(aSize)) {
// Just check for negative/zero size instead of the full AllowedSurfaceSize() - since
// the data is already allocated we do not need to check for a possible overflow - it
// already worked.
if (aSize.width <= 0 || aSize.height <= 0) {
return nullptr;
}
if (!aDeallocator && aClosure) {