[aseprite] 07/128: Fix error when decoding GPL file

Tobias Hansen thansen at moszumanska.debian.org
Mon May 9 21:24:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit ea06140be8307ed1a6204037f25026bbd7ef1504
Author: Romain Giraud <romain.giraud at nexvision.fr>
Date:   Wed Apr 13 17:26:57 2016 +0200

    Fix error when decoding GPL file
    
    Color without name are not added to the palette.
---
 src/doc/file/gpl_file.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/doc/file/gpl_file.cpp b/src/doc/file/gpl_file.cpp
index a9d4174..87b3dbc 100644
--- a/src/doc/file/gpl_file.cpp
+++ b/src/doc/file/gpl_file.cpp
@@ -53,8 +53,11 @@ Palette* load_gpl_file(const char *filename)
     std::istringstream lineIn(line);
     // TODO add support to read the color name
     lineIn >> r >> g >> b;
-    if (lineIn.good())
-      pal->addEntry(rgba(r, g, b, 255));
+
+    if (lineIn.fail())
+        continue;
+
+    pal->addEntry(rgba(r, g, b, 255));
   }
 
   return pal.release();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list