summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/AVS/src/utils.cpp6
-rw-r--r--plugins/AdvaImg/src/main.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp
index fefbfd0596..0b94ecb461 100644
--- a/plugins/AVS/src/utils.cpp
+++ b/plugins/AVS/src/utils.cpp
@@ -315,10 +315,10 @@ int Proto_AvatarImageProportion(const char *proto)
void Proto_GetAvatarMaxSize(const char *proto, int *width, int *height)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS)) {
- POINT maxSize;
+ POINT maxSize = { 0 };
CallProtoService(proto, PS_GETAVATARCAPS, AF_MAXSIZE, (LPARAM)&maxSize);
- *width = maxSize.y;
- *height = maxSize.x;
+ *width = maxSize.x;
+ *height = maxSize.y;
}
else {
*width = 300;
diff --git a/plugins/AdvaImg/src/main.cpp b/plugins/AdvaImg/src/main.cpp
index f522f8b499..5ba893dd51 100644
--- a/plugins/AdvaImg/src/main.cpp
+++ b/plugins/AdvaImg/src/main.cpp
@@ -214,8 +214,8 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
ResizeBitmap *info = (ResizeBitmap *) wParam;
if (info == NULL || info->size != sizeof(ResizeBitmap)
- || info->hBmp == NULL || info->max_width <= 0
- || info->max_height <= 0
+ || info->hBmp == NULL
+ || info->max_width < 0 || info->max_height < 0
|| (info->fit & ~RESIZEBITMAP_FLAG_DONT_GROW) < RESIZEBITMAP_STRETCH
|| (info->fit & ~RESIZEBITMAP_FLAG_DONT_GROW) > RESIZEBITMAP_MAKE_SQUARE)
return 0;
@@ -225,8 +225,8 @@ static INT_PTR serviceBmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam)
// Calc final size
GetObject(info->hBmp, sizeof(bminfo), &bminfo);
- width = info->max_width;
- height = info->max_height;
+ width = info->max_width == 0 ? bminfo.bmWidth : info->max_width;
+ height = info->max_height == 0 ? bminfo.bmHeight : info->max_height;
xOrig = 0;
yOrig = 0;