Kaydet (Commit) 35bb14d8 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#3782 libjpeg ubsan woes

https://github.com/libjpeg-turbo/libjpeg-turbo/issues/171

Change-Id: Ic6d7e27f88a542d78f3257418099c8fd875b04c9
Reviewed-on: https://gerrit.libreoffice.org/43812Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ffb19c5b
......@@ -17,3 +17,23 @@
put_bits -= 8;
}
--- jdarith.c
+++ jdarith.c
@@ -306,7 +306,7 @@
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
- entropy->last_dc_val[ci] += v;
+ entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
}
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
@@ -564,7 +564,7 @@
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
- entropy->last_dc_val[ci] += v;
+ entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
}
if (block)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment