mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1236227, don't OOM in TextDecoder, r=baku
This commit is contained in:
parent
c400438df8
commit
2611069ac0
@ -75,7 +75,11 @@ TextDecoder::Decode(const char* aInput, const int32_t aLength,
|
||||
rv = mDecoder->Convert(aInput, &length, buf, &outLen);
|
||||
MOZ_ASSERT(mFatal || rv != NS_ERROR_ILLEGAL_INPUT);
|
||||
buf[outLen] = 0;
|
||||
aOutDecodedString.Append(buf, outLen);
|
||||
|
||||
if (!aOutDecodedString.Append(buf, outLen, fallible)) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
|
||||
// If the internal streaming flag of the decoder object is not set,
|
||||
// then reset the encoding algorithm state to the default values
|
||||
|
Loading…
Reference in New Issue
Block a user