[Libreoffice-commits] core.git: filter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 9 11:46:19 UTC 2020


 filter/source/graphicfilter/icgm/class1.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit ff8a2eda2542c59d9aed38008ea62f1f01101983
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 9 10:12:58 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 9 13:45:35 2020 +0200

    ofz: Invalid-enum-value
    
    Change-Id: Ia02e2decc29e0ad9e1eab0cad121b086bf8c07c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104112
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx
index ec8cd9246cdb..289e28db428f 100644
--- a/filter/source/graphicfilter/icgm/class1.cxx
+++ b/filter/source/graphicfilter/icgm/class1.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <sal/config.h>
+#include <sal/log.hxx>
 
 #include <o3tl/safeint.hxx>
 
@@ -197,7 +198,13 @@ void CGM::ImplDoClass1()
         }
         break;
         case 0x0f : /*Character Coding Announcer*/
-            pElement->eCharacterCodingA = static_cast<CharacterCodingA>(ImplGetUI16());
+        {
+            auto nCharacterCoding = ImplGetUI16();
+            if (nCharacterCoding <= CCA_EXT_8)
+                pElement->eCharacterCodingA = static_cast<CharacterCodingA>(nCharacterCoding);
+            else
+                SAL_WARN("filter.icgm", "CharacterCoding " << nCharacterCoding << " requested, but legal max is " << CCA_EXT_8);
+        }
         break;
         case 0x10 : /*Name Precision */break;                   // NS
         case 0x11 : /*Maximum VDC Extent */break;               // NS


More information about the Libreoffice-commits mailing list