Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-09-07 14:08:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-09-07 14:28:05 +0300
commit1b0dd5a2150c2207768ba74c1a25b842f3d4ece1 (patch)
tree8ab9418bf8e110942258a0135fbd39e1bf8103bb /source/blender/blendthumb
parented779333bb82a483c3f7833b959610c08f0bacb7 (diff)
Cleanup: style, spelling
Diffstat (limited to 'source/blender/blendthumb')
-rw-r--r--source/blender/blendthumb/src/BlenderThumb.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blendthumb/src/BlenderThumb.cpp b/source/blender/blendthumb/src/BlenderThumb.cpp
index 94dae437260..bfb13d98f45 100644
--- a/source/blender/blendthumb/src/BlenderThumb.cpp
+++ b/source/blender/blendthumb/src/BlenderThumb.cpp
@@ -174,11 +174,13 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
char version[4];
version[3] = '\0';
_pStream->Read(&version, 3, &BytesRead);
- if (BytesRead != 3)
+ if (BytesRead != 3) {
return E_UNEXPECTED;
+ }
int iVersion = atoi(version);
- if (iVersion < 250)
+ if (iVersion < 250) {
return S_FALSE;
+ }
// 32 or 64 bit blend?
SeekPos.QuadPart = 7;
@@ -208,8 +210,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
continue;
}
}
- else
+ else {
break; // eof
+ }
// Found the block
SeekPos.QuadPart = BlockOffset + HeaderSize;
@@ -224,8 +227,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
char *pRGBA = new char[BlockSize];
_pStream->Read(pRGBA, BlockSize, &BytesRead);
- if (BytesRead != (ULONG)BlockSize)
+ if (BytesRead != (ULONG)BlockSize) {
return E_UNEXPECTED;
+ }
// Convert to BGRA for Windows
for (int i = 0; i < BlockSize; i += 4) {
@@ -244,16 +248,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
if (0 != memcpy_s(&FlippedImage[(height - i - 1) * LineSize],
LineSize,
&pRGBA[i * LineSize],
- LineSize))
+ LineSize)) {
return E_UNEXPECTED;
+ }
}
delete[] pRGBA;
pRGBA = FlippedImage;
// Create image
*phbmp = CreateBitmap(width, height, 1, 32, pRGBA);
- if (!*phbmp)
+ if (!*phbmp) {
return E_FAIL;
+ }
*pdwAlpha = WTSAT_ARGB; // it's actually BGRA, not sure why this works
// Scale down if required
@@ -297,16 +303,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
DeleteObject(*phbmp);
*phbmp = ResizedHBmp;
}
- else
+ else {
DeleteObject(ResizedHBmp);
+ }
pIScaler->Release();
}
WICBmp->Release();
pImgFac->Release();
}
- else
+ else {
hr = S_OK;
+ }
break;
}
return hr;