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



commit fcb9de07f6cd35666aa29c83cf01c95e8c113b25
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.

 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 a2a096f6b3..d46f2ae062 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -1051,13 +1051,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]