aboutsummaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
Diffstat (limited to 'image')
-rw-r--r--image/codecs/indeo/get_bits.h5
-rw-r--r--image/codecs/indeo4.cpp4
-rw-r--r--image/codecs/indeo5.cpp4
3 files changed, 6 insertions, 7 deletions
diff --git a/image/codecs/indeo/get_bits.h b/image/codecs/indeo/get_bits.h
index c2d593bfb5..f972e68ae0 100644
--- a/image/codecs/indeo/get_bits.h
+++ b/image/codecs/indeo/get_bits.h
@@ -31,15 +31,14 @@ namespace Indeo {
/**
* Intel Indeo Bitstream reader
*/
-class GetBits : public Common::BitStream8LSB {
+class GetBits : public Common::BitStreamMemory8LSB {
public:
/**
* Constructor
* @param stream Source stream to reader from
* @param disposeAfterUse Whether to destroy stream in destructor
*/
- GetBits(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse
- = DisposeAfterUse::YES) : Common::BitStream8LSB(stream, disposeAfterUse) {}
+ GetBits(const uint8 *ptr, uint32 size) : Common::BitStreamMemory8LSB(new Common::BitStreamMemoryStream(ptr, size), DisposeAfterUse::YES) {}
/**
* The number of bits left
diff --git a/image/codecs/indeo4.cpp b/image/codecs/indeo4.cpp
index 4658068b27..ead1d3a814 100644
--- a/image/codecs/indeo4.cpp
+++ b/image/codecs/indeo4.cpp
@@ -56,7 +56,7 @@ bool Indeo4Decoder::isIndeo4(Common::SeekableReadStream &stream) {
stream.seek(-16, SEEK_CUR);
// Validate the first 18-bit word has the correct identifier
- Indeo::GetBits gb(new Common::MemoryReadStream(buffer, 16 * 8), DisposeAfterUse::YES);
+ Indeo::GetBits gb(buffer, 16 * 8);
bool isIndeo4 = gb.getBits(18) == 0x3FFF8;
return isIndeo4;
@@ -74,7 +74,7 @@ const Graphics::Surface *Indeo4Decoder::decodeFrame(Common::SeekableReadStream &
_ctx._frameSize = stream.size();
// Set up the GetBits instance for reading the data
- _ctx._gb = new GetBits(new Common::MemoryReadStream(_ctx._frameData, _ctx._frameSize));
+ _ctx._gb = new GetBits(_ctx._frameData, _ctx._frameSize);
// Decode the frame
int err = decodeIndeoFrame();
diff --git a/image/codecs/indeo5.cpp b/image/codecs/indeo5.cpp
index 858c634704..c4e98d4ac7 100644
--- a/image/codecs/indeo5.cpp
+++ b/image/codecs/indeo5.cpp
@@ -67,7 +67,7 @@ bool Indeo5Decoder::isIndeo5(Common::SeekableReadStream &stream) {
stream.seek(-16, SEEK_CUR);
// Validate the first 5-bit word has the correct identifier
- Indeo::GetBits gb(new Common::MemoryReadStream(buffer, 16 * 8));
+ Indeo::GetBits gb(buffer, 16 * 8);
bool isIndeo5 = gb.getBits(5) == 0x1F;
return isIndeo5;
@@ -85,7 +85,7 @@ const Graphics::Surface *Indeo5Decoder::decodeFrame(Common::SeekableReadStream &
_ctx._frameSize = stream.size();
// Set up the GetBits instance for reading the data
- _ctx._gb = new GetBits(new Common::MemoryReadStream(_ctx._frameData, _ctx._frameSize));
+ _ctx._gb = new GetBits(_ctx._frameData, _ctx._frameSize);
// Decode the frame
int err = decodeIndeoFrame();