From 5ca03e2263eef4d5617ef05f87331566a78a3a2d Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 14 Jun 2015 15:19:10 +0000 Subject: [PATCH] Use unique_ptr array in PNGLibrary comments method. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3172 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/common/PNGLibrary.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/PNGLibrary.cxx b/src/common/PNGLibrary.cxx index 874bab478..1d9ae2c1b 100644 --- a/src/common/PNGLibrary.cxx +++ b/src/common/PNGLibrary.cxx @@ -304,7 +304,7 @@ void PNGLibrary::writeComments(png_structp png_ptr, png_infop info_ptr, if(numComments == 0) return; - png_text text_ptr[numComments]; + unique_ptr text_ptr = make_ptr(numComments); for(uInt32 i = 0; i < numComments; ++i) { text_ptr[i].key = (char*) comments[i].first.c_str(); @@ -312,7 +312,7 @@ void PNGLibrary::writeComments(png_structp png_ptr, png_infop info_ptr, text_ptr[i].compression = PNG_TEXT_COMPRESSION_NONE; text_ptr[i].text_length = 0; } - png_set_text(png_ptr, info_ptr, text_ptr, numComments); + png_set_text(png_ptr, info_ptr, text_ptr.get(), numComments); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -