From f500583700bd0d2ff14ebe6e8a7b1253a629d231 Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Wed, 21 May 2003 21:47:51 +0000 Subject: [PATCH] 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 --- mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp index af0ae9eb23a..fce236ede6f 100644 --- a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp @@ -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)) {