X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=blobdiff_plain;f=grpapi%2Fgrpapi.cpp;h=0ce1b296b0fa2a59114226de0343a47c998f17b6;hb=9492b9e609e5b7aaabd76022b65a7363a189bc72;hp=6712ead17d7104adef79d82882548419d1a60fce;hpb=4d7b76a0306a5577bc7b2dd3264e75ea419f6942;p=grpapi.git diff --git a/grpapi/grpapi.cpp b/grpapi/grpapi.cpp index 6712ead..0ce1b29 100644 --- a/grpapi/grpapi.cpp +++ b/grpapi/grpapi.cpp @@ -491,10 +491,16 @@ HANDLE GRPAPI WINAPI CreateGrp(signed short *lpImageData, WORD nFrames, WORD wMa } } } + x2 = x2 - x1 + 1; + y2 = y2 - y1 + 1; + if ((WORD)x1 > 255) x1 = 255; + if ((WORD)y1 > 255) y1 = 255; + if ((WORD)x2 > 255) x2 = 255; + if ((WORD)y2 > 255) y2 = 255; lpFrameHeaders[i].Left = x1; lpFrameHeaders[i].Top = y1; - lpFrameHeaders[i].Width = x2 - x1 + 1; - lpFrameHeaders[i].Height = y2 - y1 + 1; + lpFrameHeaders[i].Width = x2; + lpFrameHeaders[i].Height = y2; if (!bNoCompress) { EncodeFrameData(lpImageData, i, &GrpHeader, &lpFrameHeaders[i], &lpFrameData[i]);