зеркало из https://github.com/mozilla/gecko-dev.git
workaround for bug #6529, don't read the first buffer until at least 4 bytes are available, otherwise the image decoder library can't tell what kind of image it is. this is a blatant hack.
This commit is contained in:
Родитель
469669450c
Коммит
28c1747a2f
|
@ -195,7 +195,7 @@ ImageConsumer::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32
|
|||
NS_RELEASE(reader);
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
|
||||
nsresult err = 0;
|
||||
PRUint32 nb;
|
||||
do {
|
||||
|
@ -206,6 +206,10 @@ ImageConsumer::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32
|
|||
if (max_read > IMAGE_BUF_SIZE) {
|
||||
max_read = IMAGE_BUF_SIZE;
|
||||
}
|
||||
|
||||
// make sure there's enough data available to decode the image.
|
||||
if (mFirstRead && length < 4)
|
||||
break;
|
||||
|
||||
err = pIStream->Read(mBuffer,
|
||||
max_read, &nb);
|
||||
|
|
Загрузка…
Ссылка в новой задаче