Description
ByteRleDecoder doesn't seek correctly when the runtime type is BooleanRleDecoderImpl. The following piece of code is located at ByteRLE.cc line 254:
ByteRLE.cc
void BooleanRleDecoderImpl::seek(PositionProvider& location) { ByteRleDecoderImpl::seek(location); uint64_t consumed = location.next(); if (consumed > 8) { throw ParseError("bad position"); } if (consumed != 0) { remainingBits = 8 - consumed; ByteRleDecoderImpl::next(&lastByte, 1, 0); } }
The basic idea of this function is to seek to the right position in the byte stream and then seek to the right bit in a specific byte. Therefore, firstly it calls ByteRleDecoderImpl::seek(location) first which is located at ByteRLE.cc line 113 as below:
ByteRLE.cc
void ByteRleDecoderImpl::seek(PositionProvider& location) { // move the input stream inputStream->seek(location); // force a re-read from the stream bufferEnd = bufferStart; // read a new header readHeader(); // skip ahead the given number of records skip(location.next()); }
However, at the end of ByteRleDecoderImpl::seek(), it calls skip(location.next()) which is actually BooleanRleDecoderImpl::skip() not ByteRleDecoderImpl::skip(). Oops!
Attachments
Issue Links
- links to