[Scummvm-cvs-logs] SF.net SVN: scummvm:[54045] scummvm/trunk/engines/sword25
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Nov 3 01:19:30 CET 2010
Revision: 54045
http://scummvm.svn.sourceforge.net/scummvm/?rev=54045&view=rev
Author: fingolfin
Date: 2010-11-03 00:19:28 +0000 (Wed, 03 Nov 2010)
Log Message:
-----------
SWORD25: cleanup
Modified Paths:
--------------
scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
scummvm/trunk/engines/sword25/gfx/image/renderedimage.cpp
scummvm/trunk/engines/sword25/gfx/image/swimage.cpp
Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-11-02 23:22:25 UTC (rev 54044)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-11-03 00:19:28 UTC (rev 54045)
@@ -244,10 +244,12 @@
if (_theoraComment.user_comments[i]) {
int len = _theoraComment.comment_lengths[i];
char *value = (char *)malloc(len + 1);
- memcpy(value, _theoraComment.user_comments[i], len);
- value[len] = '\0';
- debug(1, "\t%s", value);
- free(value);
+ if (value) {
+ memcpy(value, _theoraComment.user_comments[i], len);
+ value[len] = '\0';
+ debug(1, "\t%s", value);
+ free(value);
+ }
}
}
}
Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2010-11-02 23:22:25 UTC (rev 54044)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2010-11-03 00:19:28 UTC (rev 54045)
@@ -309,7 +309,8 @@
// Datei laden
byte *pFileData;
uint fileSize;
- if (!(pFileData = static_cast<byte *>(pPackage->getFile(filename, &fileSize)))) {
+ pFileData = pPackage->getFile(filename, &fileSize);
+ if (!pFileData) {
BS_LOG_ERRORLN("File \"%s\" could not be loaded.", filename.c_str());
return 0;
}
Modified: scummvm/trunk/engines/sword25/gfx/image/renderedimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/renderedimage.cpp 2010-11-02 23:22:25 UTC (rev 54044)
+++ scummvm/trunk/engines/sword25/gfx/image/renderedimage.cpp 2010-11-03 00:19:28 UTC (rev 54045)
@@ -64,7 +64,8 @@
// Datei laden
byte *pFileData;
uint fileSize;
- if (!(pFileData = (byte *)pPackage->getFile(filename, &fileSize))) {
+ pFileData = pPackage->getFile(filename, &fileSize);
+ if (!pFileData) {
BS_LOG_ERRORLN("File \"%s\" could not be loaded.", filename.c_str());
return;
}
Modified: scummvm/trunk/engines/sword25/gfx/image/swimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/swimage.cpp 2010-11-02 23:22:25 UTC (rev 54044)
+++ scummvm/trunk/engines/sword25/gfx/image/swimage.cpp 2010-11-03 00:19:28 UTC (rev 54045)
@@ -53,7 +53,8 @@
// Datei laden
byte *pFileData;
uint fileSize;
- if (!(pFileData = (byte *)pPackage->getFile(filename, &fileSize))) {
+ pFileData = pPackage->getFile(filename, &fileSize);
+ if (!pFileData) {
BS_LOG_ERRORLN("File \"%s\" could not be loaded.", filename.c_str());
return;
}
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