]> git.eshelyaron.com Git - emacs.git/commitdiff
Properly sign-extend freedom and projection vector values
authorPo Lu <luangruo@yahoo.com>
Tue, 19 Dec 2023 06:39:28 +0000 (14:39 +0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 21 Dec 2023 20:53:58 +0000 (21:53 +0100)
* src/sfnt.c (GPV, GFV): Cast versors to int32_t.

(cherry picked from commit d0e3dfa764cdb5c15c2a525b455df495097a86bb)

src/sfnt.c

index 1b4cdf38bd0efd6d3206c315ded5fbdd26febc0a..c33f21215a651a2993afe1ff30a519a59579304a 100644 (file)
@@ -8080,8 +8080,8 @@ sfnt_interpret_trap (struct sfnt_interpreter *interpreter,
     vector                                     \
       = interpreter->state.projection_vector;  \
                                                \
-    PUSH ((uint16_t) vector.x);                        \
-    PUSH ((uint16_t) vector.y);                        \
+    PUSH ((int32_t) vector.x);                 \
+    PUSH ((int32_t) vector.y);                 \
   }
 
 #define GFV()                                  \
@@ -8091,8 +8091,8 @@ sfnt_interpret_trap (struct sfnt_interpreter *interpreter,
     vector                                     \
       = interpreter->state.freedom_vector;     \
                                                \
-    PUSH ((uint16_t) vector.x);                        \
-    PUSH ((uint16_t) vector.y);                        \
+    PUSH ((int32_t) vector.x);                 \
+    PUSH ((int32_t) vector.y);                 \
   }
 
 #define SFVTPV()                               \