зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1294677 - Check for large image sizes. r=jrmuizel
--HG-- extra : rebase_source : 7ac19edde4612d5b1378fb88ea5fb1ebed3a8987
This commit is contained in:
Родитель
3208b6ac42
Коммит
abd197b0f4
|
@ -436,6 +436,12 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
|||
imgStream = do_QueryInterface(aEncoder);
|
||||
}
|
||||
} else {
|
||||
CheckedInt32 requiredBytes = CheckedInt32(aSize.width) * CheckedInt32(aSize.height) * 4;
|
||||
if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
||||
// no context, so we have to encode an empty image
|
||||
// note that if we didn't have a current context, the spec says we're
|
||||
// supposed to just return transparent black pixels of the canvas
|
||||
|
|
Загрузка…
Ссылка в новой задаче