[Scummvm-cvs-logs] SF.net SVN: scummvm:[44739] scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Wed Oct 7 19:01:19 CEST 2009
Revision: 44739
http://scummvm.svn.sourceforge.net/scummvm/?rev=44739&view=rev
Author: thebluegr
Date: 2009-10-07 17:01:19 +0000 (Wed, 07 Oct 2009)
Log Message:
-----------
Hopefully fixed a mismatching free() call in gfx_free_pixmap(), originating from getView()
Modified Paths:
--------------
scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-10-07 16:47:06 UTC (rev 44738)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp 2009-10-07 17:01:19 UTC (rev 44739)
@@ -550,7 +550,11 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list