* kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 22:44:45 +0000 (22:44 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Aug 2004 22:44:45 +0000 (22:44 +0000)
        Added some more assertions I used to track down what looks like a TEC bug.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7407 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQTextCodec.mm

index eaf1d693738de32bc950fdd89d711d606a2bdfe8..1f287a90d66443b7e305cd763d5f90f90bc1a30d 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-30  Darin Adler  <darin@apple.com>
+
+        * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
+        Added some more assertions I used to track down what looks like a TEC bug.
+
 2004-08-30  Darin Adler  <darin@apple.com>
 
         Reviewed by Ken.
index 5e1ceea5353b322a92ed15af589e4b6446eacde2..9a1a4bed895cf469956fc3b4cf13e90194c451d9 100644 (file)
@@ -395,6 +395,7 @@ OSStatus KWQTextDecoder::convertOneChunkUsingTEC(const unsigned char *inputBuffe
         // Now, do a conversion on the buffer.
         status = TECConvertText(_converter, _bufferedBytes, _numBufferedBytes + bytesToPutInBuffer, &bytesRead,
             reinterpret_cast<unsigned char *>(outputBuffer), outputBufferLength, &bytesWritten);
+        ASSERT(bytesRead <= _numBufferedBytes + bytesToPutInBuffer);
 
         if (status == kTECPartialCharErr && bytesRead == 0) {
             // Handle the case where the partial character was not converted.
@@ -428,6 +429,7 @@ OSStatus KWQTextDecoder::convertOneChunkUsingTEC(const unsigned char *inputBuffe
     } else {
         status = TECConvertText(_converter, inputBuffer, inputBufferLength, &bytesRead,
             static_cast<unsigned char *>(outputBuffer), outputBufferLength, &bytesWritten);
+        ASSERT(static_cast<int>(bytesRead) <= inputBufferLength);
     }
 
     // Work around bug 3351093, where sometimes we get kTECBufferBelowMinimumSizeErr instead of kTECOutputBufferFullStatus.