[gimp/gimp-2-10] Issue #5415: compensate for null byte



commit 11a43aebdf87fd19805eed171ec0417dc2726226
Author: Michael Bazzinotti <mbazzinotti gmail com>
Date:   Thu Jul 16 08:45:20 2020 -0400

    Issue #5415: compensate for null byte
    
    When exporting a C source file with runtime length encoding, the
    C-string's array size does not accomodate for the null byte. However,
    GIMP accomodates for the NULL byte in it's NON-RLE export, suggesting
    that this has been a mere oversight for RLE.
    
    This can cause at the worst a compile-time error and at least a warning
    from the compiler.
    
    (cherry picked from commit 4d528f297fc7395cde49ec642018736be8b0b4c6)

 plug-ins/common/file-csource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plug-ins/common/file-csource.c b/plug-ins/common/file-csource.c
index 2b79148afb..9bcc62377a 100644
--- a/plug-ins/common/file-csource.c
+++ b/plug-ins/common/file-csource.c
@@ -792,7 +792,7 @@ save_image (GFile   *file,
       if (config->use_rle)
         {
           if (! print (output, error,
-                       "%u] =\n",
+                       "%u + 1] =\n",
                        (guint) (img_buffer_end - img_buffer)))
             goto fail;
         }


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