diff options
author | Colin Snover | 2017-09-21 19:53:51 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-21 20:43:04 -0500 |
commit | 194984de2f8deca747b20e646cda9d54705f1723 (patch) | |
tree | c55f9ea8dbb48560fb2e8846817df396d8466be7 /image | |
parent | 8f6649cfb13be47f9fadfe50d31a0c0f2b8a28d1 (diff) | |
download | scummvm-rg350-194984de2f8deca747b20e646cda9d54705f1723.tar.gz scummvm-rg350-194984de2f8deca747b20e646cda9d54705f1723.tar.bz2 scummvm-rg350-194984de2f8deca747b20e646cda9d54705f1723.zip |
IMAGE: Remove unused end info structs from PNG code
Thanks to @dafioram for noticing the problem & sending an initial
patch, and to @wjp for noticing further that the PNG reader did not
even use the end info struct it created either.
Fixes Trac#10217. Closes gh-1028.
Diffstat (limited to 'image')
-rw-r--r-- | image/png.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/image/png.cpp b/image/png.cpp index cfbcba5206..86d33b6952 100644 --- a/image/png.cpp +++ b/image/png.cpp @@ -122,11 +122,6 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { png_destroy_read_struct(&pngPtr, NULL, NULL); return false; } - png_infop endInfo = png_create_info_struct(pngPtr); - if (!endInfo) { - png_destroy_read_struct(&pngPtr, &infoPtr, NULL); - return false; - } png_set_error_fn(pngPtr, NULL, pngError, pngWarning); // TODO: The manual says errors should be handled via setjmp @@ -239,7 +234,7 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { png_read_end(pngPtr, NULL); // Destroy libpng structures - png_destroy_read_struct(&pngPtr, &infoPtr, &endInfo); + png_destroy_read_struct(&pngPtr, &infoPtr, NULL); return true; #else @@ -287,11 +282,6 @@ bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bo png_destroy_write_struct(&pngPtr, NULL); return false; } - png_infop endInfo = png_create_info_struct(pngPtr); - if (!endInfo) { - png_destroy_write_struct(&pngPtr, &infoPtr); - return false; - } png_set_error_fn(pngPtr, NULL, pngError, pngWarning); // TODO: The manual says errors should be handled via setjmp |