Hello !!

I just saw that someone has made a comment about some part of the code handling META_DIBBITBLT operand in WMFRecordStore class. Basically, the code does :

*case* WMFConstants.META_DIBBITBLT:
  {
    ..., get operand characteristics
    *int* len = 2*recSize - 18;
    *if* (len > 0) {
      *byte*[] bitmap = *new* *byte*[len];
      *for* (*int* i = 0; i < len; i++)
      bitmap[i] = is.readByte();
    } *else* {
      /// what does this mean?? len <= 0 ??
/       mr.numPoints = recSize;
      mr.functionId = functionId;
      *for* (*int* i = 0; i < len; i++) is.readByte();
    }
 ...

The (//len <= 0//) stuff is here because often, "in the wild", WMF records are 
found
faulty (sometimes even when generated with PPT !!). The test is to be sure that 
there
is really something in the bitmap, to avoid a possible Exception. To be honest, 
I did not
found exemples of faulty WMF files for the DIBBITBLT operand, but for another 
ones, and I had in that case to add this sort of code to handle it.

Herve




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to