[openjk] 13/32: Issue #888: Fix png loading memory leak

Simon McVittie smcv at debian.org
Sun Mar 12 18:03:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit b5796b954af8e13e077b0f4aa17552fbc1262c9d
Author: Xycaleth <alex at acslo.com>
Date:   Fri Mar 10 23:00:26 2017 +0000

    Issue #888: Fix png loading memory leak
    
    Memory was not being released correctly for png images. Credit to
    @eezstreet for finding this problem.
---
 codemp/rd-common/tr_image_png.cpp | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/codemp/rd-common/tr_image_png.cpp b/codemp/rd-common/tr_image_png.cpp
index 7b89b78..208b042 100644
--- a/codemp/rd-common/tr_image_png.cpp
+++ b/codemp/rd-common/tr_image_png.cpp
@@ -141,16 +141,7 @@ struct PNGFileReader
 	~PNGFileReader()
 	{
 		ri->FS_FreeFile (buf);
-
-		if ( info_ptr != NULL )
-		{
-			// Destroys both structs
-			png_destroy_info_struct (png_ptr, &info_ptr);
-		}
-		else if ( png_ptr != NULL )
-		{
-			png_destroy_read_struct (&png_ptr, NULL, NULL);
-		}
+		png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
 	}
 
 	int Read ( byte **data, int *width, int *height )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list