diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-08 14:39:31 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-08 14:39:31 +0300 |
commit | 664dbdb0cb541f5bcfe334a73a2166a5a25d8920 (patch) | |
tree | 3b09b69304187618537407dece88024c4d6bd71d /protocols | |
parent | 17114ae19c513e619fd4f2164afd3dd0d0ce2a40 (diff) |
fixes #4637 (Jabber: avatat file size is not checked)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_vcard.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 2e2b15470e..8149bb15be 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -379,14 +379,7 @@ public: ofn.Flags = OFN_FILEMUSTEXIST | OFN_DONTADDTORECENT;
szFileName[0] = '\0';
if (GetOpenFileName(&ofn)) {
- struct _stat st;
- HBITMAP hNewBitmap;
-
ppro->debugLogW(L"File selected is %s", szFileName);
- if (_wstat(szFileName, &st) < 0 || st.st_size > 40 * 1024) {
- MessageBox(m_hwnd, TranslateT("Only JPG, GIF, and BMP image files smaller than 40 KB are supported."), TranslateT("Jabber vCard"), MB_OK | MB_SETFOREGROUND);
- return;
- }
wchar_t szTempFileName[MAX_PATH], szTempPath[MAX_PATH];
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
@@ -395,7 +388,7 @@ public: if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
ppro->debugLogW(L"Temp file = %s", szTempFileName);
if (CopyFile(szFileName, szTempFileName, FALSE) == TRUE) {
- if ((hNewBitmap = Bitmap_Load(szTempFileName)) != nullptr) {
+ if (HBITMAP hNewBitmap = Bitmap_Load(szTempFileName)) {
if (hBitmap) {
DeleteObject(hBitmap);
DeleteFile(ppro->m_szPhotoFileName);
|