fix corruption and or crash when runing quicktime plugin r=peterl, sr=darin, a=sspitzer 206530

git-svn-id: svn://10.0.0.236/trunk@142721 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
2003-05-21 21:47:51 +00:00
parent 60066afd6c
commit f500583700

View File

@@ -365,14 +365,9 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
if ((PRInt32)mNPStream.end < streamOffset)
mNPStream.end = streamOffset;
PRUint32 bytesToRead = mStreamBufferSize;
if (length < mStreamBufferSize) {
// do not read more that supplier wants us to read
bytesToRead = length;
}
do
{
PRUint32 bytesToRead = PR_MIN(length, mStreamBufferSize);
PRInt32 amountRead = 0;
rv = input->Read(mStreamBuffer, bytesToRead, (PRUint32*)&amountRead);
if (amountRead == 0 || NS_FAILED(rv)) {