diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-24 18:19:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-24 18:19:31 +0300 |
commit | 7d4ed0164a32a3667fb3786fb538fc083153883a (patch) | |
tree | 8450ef2991644997a8012d7d532b361a56456ced /plugins/AVS/src | |
parent | 9a7d075ed476ac2990a9a633b131b39b7e3e9945 (diff) |
AVS: fix for memory corruption
Diffstat (limited to 'plugins/AVS/src')
-rw-r--r-- | plugins/AVS/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/AVS/src/stdafx.h | 7 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 8 | ||||
-rw-r--r-- | plugins/AVS/src/version.h | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 2353e978fe..4a22874456 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -346,7 +346,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar AVATARDRAWREQUEST avdrq = { 0 }; avdrq.hTargetDC = dis->hDC; avdrq.dwFlags |= AVDRQ_PROTOPICT; - avdrq.szProto = (g_selectedProto) ? g_selectedProto->szProtoname.get() : nullptr; + avdrq.szProto = (g_selectedProto) ? g_selectedProto->szProtoname : nullptr; GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), &avdrq.rcDraw); CallService(MS_AV_DRAWAVATAR, 0, (LPARAM)&avdrq); } diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index b698cbf861..6372bd24ae 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -94,15 +94,12 @@ struct CacheNode : public AVATARCACHEENTRY, public MZeroedObject struct protoPicCacheEntry : public AVATARCACHEENTRY, public MZeroedObject
{
- protoPicCacheEntry(int _type, const char *_szName) :
- cacheType(_type),
- szProtoname(mir_strdup(_szName))
- {}
+ protoPicCacheEntry(int _type, const char *_szName);
~protoPicCacheEntry();
void clear();
- ptrA szProtoname;
+ char *szProtoname;
int cacheType;
union {
PROTOCOLDESCRIPTOR *pd = 0;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 67f77e3a90..121fe9ea3d 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -266,8 +266,16 @@ int GetFileHash(wchar_t *filename) ///////////////////////////////////////////////////////////////////////////////////////////////////
+protoPicCacheEntry::protoPicCacheEntry(int _type, const char *_szName) :
+ cacheType(_type),
+ szProtoname(mir_strdup(_szName))
+{
+}
+
protoPicCacheEntry::~protoPicCacheEntry()
{
+ mir_free(szProtoname);
+
if (hbmPic != nullptr)
DeleteObject(hbmPic);
}
diff --git a/plugins/AVS/src/version.h b/plugins/AVS/src/version.h index 78441f5461..eb064c91a5 100644 --- a/plugins/AVS/src/version.h +++ b/plugins/AVS/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 98
#define __RELEASE_NUM 1
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>
|