Skip to content

Commit

Permalink
幅or高さがImageの上限(16384px)より大きいGIFファイルを読むとアクセス違反が起きるのを修正 (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4saka authored Dec 27, 2023
1 parent d6bff59 commit 6c63dfb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,19 @@ namespace s3d

if ((width == 0) || (height == 0))
{
DGifCloseFile(gif, &error);

return{};
}

Image image{ width, height };
if (!image)
{
DGifCloseFile(gif, &error);

return{};
}

Color* pDst = image.data();

for (size_t y = 0; y < height; ++y)
Expand Down

0 comments on commit 6c63dfb

Please sign in to comment.