From afa735cec4491c5986c459e889e17fcea94853a5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 28 Nov 2013 14:19:33 -0500 Subject: FULLPIPE: Fix crash at scene03 load --- engines/fullpipe/gfx.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engines/fullpipe/gfx.cpp') diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 2e89bd6003..fba7e402d2 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -464,6 +464,8 @@ Picture::~Picture() { } void Picture::freePicture() { + debug(5, "Picture::freePicture(): file: %s", _memfilename); + if (_bitmap) { if (testFlags() && !_field_54) { freeData(); @@ -519,7 +521,7 @@ bool Picture::load(MfcArchive &file) { getData(); - debug(5, "Picture::load: <%s>", _memfilename); + debug(5, "Picture::load: loaded <%s>", _memfilename); return true; } @@ -539,6 +541,10 @@ void Picture::setAOIDs() { } void Picture::init() { + debug(5, "Picture::init(), %s", _memfilename); + + MemoryObject::getData(); + _bitmap = new Bitmap(); getDibInfo(); @@ -567,6 +573,12 @@ void Picture::getDibInfo() { warning("Uneven data size: 0x%x", _dataSize); } + if (!_data) { + warning("Picture::getDibInfo: data is empty <%s>", _memfilename); + + MemoryObject::load(); + } + Common::MemoryReadStream *s = new Common::MemoryReadStream(_data + off - 32, 32); _bitmap->load(s); -- cgit v1.2.3