aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-07 17:01:19 +0000
committerFilippos Karapetis2009-10-07 17:01:19 +0000
commit94a9616d909850703b7c9c9f736bdc82d5494b7f (patch)
tree91d8fd2b11dbb392061393f6f486fd8cfe5d0373 /engines
parent9f5c52b41057134b0c2c333e67cee37af023d1c9 (diff)
downloadscummvm-rg350-94a9616d909850703b7c9c9f736bdc82d5494b7f.tar.gz
scummvm-rg350-94a9616d909850703b7c9c9f736bdc82d5494b7f.tar.bz2
scummvm-rg350-94a9616d909850703b7c9c9f736bdc82d5494b7f.zip
Hopefully fixed a mismatching free() call in gfx_free_pixmap(), originating from getView()
svn-id: r44739
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 773d9d4bf5..b3d31ac1c9 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -550,7 +550,11 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
view->loops[i].cels[j] = gfx_pixmap_alloc_index_data(gfx_new_pixmap(celInfo->width, celInfo->height, nr, i, j));
gfx_pixmap_t *curCel = view->loops[i].cels[j];
curCel->color_key = celInfo->clearKey;
- curCel->index_data = guiView->getBitmap(i, j);
+ // old code uses malloc() here, so we do so as well, as the buffer will be freed with free() in gfx_free_pixmap
+ curCel->index_data = (byte *)malloc(celInfo->width * celInfo->height);
+ byte *tmpBuffer = guiView->getBitmap(i, j);
+ memcpy(curCel->index_data, tmpBuffer, celInfo->width * celInfo->height);
+ delete tmpBuffer;
curCel->flags = 0;
curCel->width = celInfo->width;
curCel->height = celInfo->height;