Skip to content

Commit

Permalink
GdiplusのLockBitsの確認を怠っていた問題の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Ojii committed May 27, 2024
1 parent 90af786 commit 1578769
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dll_src/ImageLoader_M.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ std::optional<ImageData> get_image_data_gdiplus(std::string_view filename) {

Gdiplus::Rect rect(0, 0, data.width, data.height);
Gdiplus::BitmapData bmpData;
image->LockBits(&rect, Gdiplus::ImageLockModeRead, PixelFormat32bppARGB, &bmpData);
if (image->LockBits(&rect, Gdiplus::ImageLockModeRead, PixelFormat32bppARGB, &bmpData) != Gdiplus::Status::Ok)
return std::nullopt;
memcpy(mapped_pixels.pixels, reinterpret_cast<byte*>(bmpData.Scan0), bytes);
image->UnlockBits(&bmpData);

Expand Down

0 comments on commit 1578769

Please sign in to comment.