Bug 1688368 - Check mFeedChardet before feeding the detector. r=emk

Differential Revision: https://phabricator.services.mozilla.com/D102905
This commit is contained in:
Henri Sivonen
2021-01-27 10:36:39 +00:00
parent d62f466825
commit 7d7d2dc1cc
4 changed files with 60 additions and 1 deletions

View File

@@ -646,7 +646,7 @@ static void HandleProcessingInstruction(void* aUserData,
void nsHtml5StreamParser::FinalizeSniffingWithDetector(
Span<const uint8_t> aFromSegment, uint32_t aCountToSniffingLimit,
bool aEof) {
if (mSniffingBuffer) {
if (mFeedChardet && mSniffingBuffer) {
FeedDetector(Span(mSniffingBuffer.get(), mSniffingLength), false);
}
if (mFeedChardet && !aFromSegment.IsEmpty()) {