Bug 435220 – Dropping images to Total Commander produces broken image. r=emaijala, sr=roc

This commit is contained in:
Honza Bambas 2008-08-04 13:00:07 +02:00
parent edf447a179
commit bbcdbbf956

View File

@ -190,10 +190,16 @@ STDMETHODIMP nsDataObj::CStream::Read(void* pvBuffer,
NS_ENSURE_TRUE(mInputStream, E_FAIL);
nsresult rv;
PRUint32 read = 0;
rv = mInputStream->Read((char*)pvBuffer, nBytesToRead, &read);
*nBytesRead = read;
NS_ENSURE_SUCCESS(rv, S_FALSE);
PRUint32 read;
*nBytesRead = 0;
do {
read = 0;
rv = mInputStream->Read((char*)pvBuffer + *nBytesRead, nBytesToRead - *nBytesRead, &read);
NS_ENSURE_SUCCESS(rv, S_FALSE);
*nBytesRead += read;
} while ((*nBytesRead < nBytesToRead) && read);
return S_OK;
}