Bug 1890090. Check return value of WebPInitDecBuffer in webp decoder. r=gfx-reviewers,lsalzman

libwebp 1.4.0 makes this function no discard so we'll have to check it.

Differential Revision: https://phabricator.services.mozilla.com/D206837
This commit is contained in:
Timothy Nikkel 2024-04-06 04:27:37 +00:00
parent a39aed6c20
commit 862f126871

View file

@ -219,7 +219,13 @@ nsresult nsWebPDecoder::CreateFrame(const OrientedIntRect& aFrameRect) {
PostHasTransparency();
}
WebPInitDecBuffer(&mBuffer);
if (!WebPInitDecBuffer(&mBuffer)) {
MOZ_LOG(
sWebPLog, LogLevel::Error,
("[this=%p] nsWebPDecoder::CreateFrame -- WebPInitDecBuffer failed\n",
this));
return NS_ERROR_FAILURE;
}
switch (SurfaceFormat::OS_RGBA) {
case SurfaceFormat::B8G8R8A8: