diff options
author | Paul Gilbert | 2016-09-08 23:07:26 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-09-10 10:08:19 -0400 |
commit | 3a2ee8ea23247f72628294b48b43716c1b84d8a8 (patch) | |
tree | 27cd1dd05c3dcc313ed5a16cc94d8ded84e744dd /image/codecs/indeo4.cpp | |
parent | 400661182efae9659e664fec0e81c7ed8c3a10ec (diff) | |
download | scummvm-rg350-3a2ee8ea23247f72628294b48b43716c1b84d8a8.tar.gz scummvm-rg350-3a2ee8ea23247f72628294b48b43716c1b84d8a8.tar.bz2 scummvm-rg350-3a2ee8ea23247f72628294b48b43716c1b84d8a8.zip |
IMAGE: Fixes for setup of Indeo4 decoder
Diffstat (limited to 'image/codecs/indeo4.cpp')
-rw-r--r-- | image/codecs/indeo4.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/image/codecs/indeo4.cpp b/image/codecs/indeo4.cpp index 936d4b0456..11a6577a7a 100644 --- a/image/codecs/indeo4.cpp +++ b/image/codecs/indeo4.cpp @@ -42,6 +42,9 @@ namespace Image { Indeo4Decoder::Indeo4Decoder(uint16 width, uint16 height) : IndeoDecoderBase(width, height) { _ctx.is_indeo4 = true; + _ctx.ref_buf = 1; + _ctx.b_ref_buf = 3; + _ctx.p_frame = new AVFrame(); } bool Indeo4Decoder::isIndeo4(Common::SeekableReadStream &stream) { @@ -66,15 +69,24 @@ const Graphics::Surface *Indeo4Decoder::decodeFrame(Common::SeekableReadStream & if (!isIndeo4(stream)) return nullptr; - // Set up the GetBits instance for reading the stream - _ctx.gb = new GetBits(stream); + // Set up the frame data buffer + byte *frameData = new byte[stream.size()]; + stream.read(frameData, stream.size()); + _ctx.frame_data = frameData; + _ctx.frame_size = stream.size(); + + // Set up the GetBits instance for reading the data + _ctx.gb = new GetBits(_ctx.frame_data, _ctx.frame_size * 8); // Decode the frame int err = decodeIndeoFrame(); - // Free the bit reader + // Free the bit reader and frame buffer delete _ctx.gb; _ctx.gb = nullptr; + delete[] frameData; + _ctx.frame_data = nullptr; + _ctx.frame_size = 0; return (err < 0) ? nullptr : &_surface->rawSurface(); } |