aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-09-21 19:53:51 -0500
committerColin Snover2017-09-21 20:43:04 -0500
commit194984de2f8deca747b20e646cda9d54705f1723 (patch)
treec55f9ea8dbb48560fb2e8846817df396d8466be7
parent8f6649cfb13be47f9fadfe50d31a0c0f2b8a28d1 (diff)
downloadscummvm-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.
-rw-r--r--image/png.cpp12
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