[cairo-commit] 2 commits - src/cairo-cff-subset.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 22 14:21:58 UTC 2021


 src/cairo-cff-subset.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e5e63a04623db06a3b96883ea2f8849457ad35f5
Merge: ab82549f0 caf422b00
Author: Uli Schlachter <psychon at znc.in>
Date:   Thu Jul 22 14:21:56 2021 +0000

    Merge branch 'issue-399' into 'master'
    
    cff: use correct size cast when decoding bytes to a signed int
    
    Closes #399
    
    See merge request cairo/cairo!204

commit caf422b00bf29e3518f8dce2f57edda0f90287bd
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jul 21 22:21:37 2021 +0930

    cff: use correct size cast when decoding bytes to a signed int
    
    Fixes #399

diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 62340e2a8..2b713410e 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -247,10 +247,10 @@ static unsigned char *
 decode_integer (unsigned char *p, int *integer)
 {
     if (*p == 28) {
-        *integer = (int)(p[1]<<8 | p[2]);
+        *integer = (int16_t)(p[1]<<8 | p[2]);
         p += 3;
     } else if (*p == 29) {
-        *integer = (int)(((uint32_t)p[1] << 24) | (p[2] << 16) | (p[3] << 8) | p[4]);
+        *integer = (int32_t)(((uint32_t)p[1] << 24) | (p[2] << 16) | (p[3] << 8) | p[4]);
         p += 5;
     } else if (*p >= 32 && *p <= 246) {
         *integer = *p++ - 139;


More information about the cairo-commit mailing list