[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters/krita/png
From:       Cyrille Berger <cyb () lepi ! org>
Date:       2005-12-31 18:00:35
Message-ID: 1136052035.650394.9606.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 492951 by berger:

make valgrind happier


 M  +12 -13    kis_png_converter.cc  


--- trunk/koffice/filters/krita/png/kis_png_converter.cc #492950:492951
@@ -178,18 +178,17 @@
     int compression_type;
     png_uint_32 proflen;
     
-    png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, &profile_data, &proflen);
-    
     KisProfile* profile = 0;
-    QByteArray profile_rawdata;
-    // XXX: Hardcoded for icc type -- is that correct for us?
-    if (QString::compare(profile_name, "icc") == 0) {
-       
-        profile_rawdata.resize(proflen);
-        memcpy(profile_rawdata.data(), profile_data, proflen);
-
-        profile = new KisProfile(profile_rawdata);
-        Q_CHECK_PTR(profile);
+    if(png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, &profile_data, &proflen))
+    {
+        QByteArray profile_rawdata;
+        // XXX: Hardcoded for icc type -- is that correct for us?
+        if (QString::compare(profile_name, "icc") == 0) {
+            profile_rawdata.resize(proflen);
+            memcpy(profile_rawdata.data(), profile_data, proflen);
+            profile = new KisProfile(profile_rawdata);
+            Q_CHECK_PTR(profile);
+        }
     }
 
     // Retrieve a pointer to the colorspace
@@ -585,9 +584,9 @@
     // Free memory
     png_destroy_write_struct(&png_ptr, &info_ptr);
     for (int y = 0; y < height; y++) {
-        delete row_pointers[y];
+        delete[] row_pointers[y];
     }
-    delete row_pointers;
+    delete[] row_pointers;
 
     fclose(fp);
     
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic