From 7109e26d04a90b718ad2ed635e0aeb35b011abd7 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 5 Apr 2012 12:50:36 +0100 Subject: VIDEO: Workaround for out of buffer accesses in SVQ1 codec. This is a temporary workaround during development. Keyframe (I) decoding is now working correctly, but Deltaframe (P) is still giving corrupted output... --- video/codecs/svq1.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'video/codecs') diff --git a/video/codecs/svq1.cpp b/video/codecs/svq1.cpp index 5ef45c25a1..f19625bf64 100644 --- a/video/codecs/svq1.cpp +++ b/video/codecs/svq1.cpp @@ -283,9 +283,11 @@ const Graphics::Surface *SVQ1Decoder::decodeImage(Common::SeekableReadStream *st } byte *current[3]; - current[0] = new byte[_width*_height]; - current[1] = new byte[(_width/4)*(_height/4)]; - current[2] = new byte[(_width/4)*(_height/4)]; + // FIXME - Added extra _width of 16px blocks to stop out of + // range access causing crashes. Need to correct code... + current[0] = new byte[_width*_height +(_width*16)]; + current[1] = new byte[(_width/4)*(_height/4) +(_width/4*16)]; + current[2] = new byte[(_width/4)*(_height/4) +(_width/4*16)]; // Decode Y, U and V component planes for (int i = 0; i < 3; i++) { -- cgit v1.2.3