mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix some errors with handling invalid sequences in the EUC-JP decoder. Bug 563618, r=Masatoshi Kimura <VYV03354@nifty.ne.jp>
This commit is contained in:
parent
c3e7f17ab2
commit
c2c99a0943
@ -344,10 +344,10 @@ NS_IMETHODIMP nsEUCJPToUnicodeV2::Convert(
|
||||
goto error_invalidchar;
|
||||
*dest++ = 0xFFFD;
|
||||
// if the first byte is valid for EUC-JP but the second
|
||||
// is not while being a valid US-ASCII(i.e. < 0xc0), save it
|
||||
// is not while being a valid US-ASCII, save it
|
||||
// instead of eating it up !
|
||||
if ( ! (*src & 0xc0) )
|
||||
*dest++ = (PRUnichar) *src;;
|
||||
if ( (PRUint8)*src < (PRUint8)0x7f )
|
||||
--src;
|
||||
} else {
|
||||
*dest++ = gJapaneseMap[mData+off];
|
||||
}
|
||||
@ -368,7 +368,7 @@ NS_IMETHODIMP nsEUCJPToUnicodeV2::Convert(
|
||||
// if 0x8e is not followed by a valid JIS X 0201 byte
|
||||
// but by a valid US-ASCII, save it instead of eating it up.
|
||||
if ( (PRUint8)*src < (PRUint8)0x7f )
|
||||
*dest++ = (PRUnichar) *src;
|
||||
--src;
|
||||
}
|
||||
mState = 0;
|
||||
if(dest >= destEnd)
|
||||
|
Loading…
Reference in New Issue
Block a user