diff --git a/Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp b/Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp index cbfa865e7..7abdb6c9f 100644 --- a/Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp +++ b/Siv3D/src/Siv3D/ImageFormat/GIF/GIFDecoder.cpp @@ -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)