From befb99a8dd4abd913cd0699e550f1967d75a69ba Mon Sep 17 00:00:00 2001 From: Seunghwan Lee Date: Mon, 14 Jan 2013 13:51:21 +0900 Subject: [PATCH] Fixed Prevent Bug --- plugin/mms_plugin/MmsPluginDecode.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin/mms_plugin/MmsPluginDecode.cpp b/plugin/mms_plugin/MmsPluginDecode.cpp index 0d24ece..7365738 100755 --- a/plugin/mms_plugin/MmsPluginDecode.cpp +++ b/plugin/mms_plugin/MmsPluginDecode.cpp @@ -2151,6 +2151,9 @@ static bool __MmsBinaryDecodeMultipart(FILE *pFile, char *szFilePath, MsgType *p goto __CATCH; } + if (pMsgBody->body.pMultipart != NULL) + pLastMultipart = pMsgBody->body.pMultipart; + while (nEntries) { MSG_DEBUG("decoding %dth multipart\n", index); @@ -2181,13 +2184,9 @@ static bool __MmsBinaryDecodeMultipart(FILE *pFile, char *szFilePath, MsgType *p presentationInfo.pCurPresentation = pMultipart; } - if (pMsgBody->body.pMultipart == NULL) { - /* first multipart */ - pMsgBody->body.pMultipart = pMultipart; - } - if (pLastMultipart == NULL) { /* first multipart */ + pMsgBody->body.pMultipart = pMultipart; pLastMultipart = pMultipart; pPreMultipart = NULL; } else { @@ -5579,10 +5578,11 @@ static bool __MsgResolveNestedMultipart(MsgType *pPartType, MsgBody *pPartBody) goto __CATCH; } - if (pSelectedPart->pBody != NULL) - memcpy(pPartBody, pSelectedPart->pBody, sizeof(MsgBody)); - if (pSelectedPart != NULL) { + + if (pSelectedPart->pBody != NULL) + memcpy(pPartBody, pSelectedPart->pBody, sizeof(MsgBody)); + #ifdef __SUPPORT_DRM__ MmsReleaseMsgDRMInfo(&pSelectedPart->type.drmInfo); #endif -- 2.7.4