From c2dd106d2da0d6c0118662efe485135150c0de41 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 24 May 2015 17:02:28 +0000 Subject: AdvaImg: fixed image loading without size restriction AVS: fixed avatar coordinates git-svn-id: http://svn.miranda-ng.org/main/trunk@13816 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AdvaImg/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/AdvaImg/src') 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; -- cgit v1.2.3