[Scummvm-git-logs] scummvm master -> 194984de2f8deca747b20e646cda9d54705f1723
csnover
csnover at users.noreply.github.com
Fri Sep 22 04:05:40 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
194984de2f IMAGE: Remove unused end info structs from PNG code
Commit: 194984de2f8deca747b20e646cda9d54705f1723
https://github.com/scummvm/scummvm/commit/194984de2f8deca747b20e646cda9d54705f1723
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-21T20:43:04-05:00
Commit Message:
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.
Changed paths:
image/png.cpp
diff --git a/image/png.cpp b/image/png.cpp
index cfbcba5..86d33b6 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
More information about the Scummvm-git-logs
mailing list