Skip to content

Commit

Permalink
REGRESSION(279097@main): [Win GTK WPE] ASSERTION FAILED: isASCII(char…
Browse files Browse the repository at this point in the history
…acters[i]) in WTF::StringLiterals::operator""_span under WebCore::ICOImageDecoder::imageTypeAtIndex

https://bugs.webkit.org/show_bug.cgi?id=274549

Reviewed by Fujii Hironori.

Don't use ""_span since it requires all characters to be ASCII.

* Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::imageTypeAtIndex):

Canonical link: https://commits.webkit.org/279167@main
  • Loading branch information
cdumez committed May 23, 2024
1 parent 3216dc5 commit 298b67c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ ICOImageDecoder::ImageType ICOImageDecoder::imageTypeAtIndex(size_t index)
const uint32_t imageOffset = m_dirEntries[index].m_imageOffset;
if ((imageOffset > m_data->size()) || ((m_data->size() - imageOffset) < 4))
return Unknown;
return equalSpans(m_data->span().subspan(imageOffset, 4), "\x89PNG"_span) ? PNG : BMP;
return equalSpans(m_data->span().subspan(imageOffset, 4), std::span { "\x89PNG", 4 }) ? PNG : BMP;
}

}

0 comments on commit 298b67c

Please sign in to comment.