[gimp/gimp-2-10] plug-ins: fix reading of creator block data of PSP images. Since string data in PSP images is not ze



commit af9ccbbe4ed59770b0cf1cc7c36851410a74b6d0
Author: Jacob Boerema <jgboerema gmail com>
Date:   Wed Aug 5 18:05:01 2020 -0400

    plug-ins: fix reading of creator block data of PSP images.
    Since string data in PSP images is not zero terminated
    reading creator block data always failed.
    
    (cherry picked from commit fcb9de07f6cd35666aa29c83cf01c95e8c113b25)

 plug-ins/common/file-psp.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index be7f962259..17cd6e0df1 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -903,13 +903,8 @@ read_creator_block (FILE      *f,
               g_free (string);
               return -1;
             }
-          if (string[length - 1] != '\0')
-            {
-              g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
-                           _("Creator keyword data not nul-terminated"));
-              g_free (string);
-              return -1;
-            }
+          /* PSP does not zero terminate strings */
+          string[length] = '\0';
           switch (keyword)
             {
             case PSP_CRTR_FLD_TITLE:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]