On Tue, Sep 8, 2015 at 12:36 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: > On 8 September 2015 at 11:20, Mathieu Malaterre wrote: >> >> [...] >> /home/mathieu/tmp/opj-bug/openjpeg/src/lib/openjp2/t1.c:1517:28: >> runtime error: left shift of negative value -128 >> [...] >> >> You've saved me hours of time ! Thanks. >> >> for reference: >> https://github.com/uclouvain/openjpeg/blob/master/src/lib/openjp2/t1.c#L1517 > > UBsan for the win! that sad news is that replacing: tiledp[tileIndex] <<= T1_NMSEDEC_FRACBITS; with tiledp[tileIndex] *= (1 << T1_NMSEDEC_FRACBITS); does clear out the runtime warning, but the bug is still there :(