diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c index 0fb1600a6d..1f4acc53fd 100644 --- a/libavcodec/j2kdec.c +++ b/libavcodec/j2kdec.c @@ -227,7 +227,7 @@ static int get_siz(J2kDecoderContext *s) uint8_t x = bytestream_get_byte(&s->buf); s->cbps[i] = (x & 0x7f) + 1; s->precision = FFMAX(s->cbps[i], s->precision); - s->sgnd[i] = (x & 0x80) == 1; + s->sgnd[i] = !!(x & 0x80); s->cdx[i] = bytestream_get_byte(&s->buf); s->cdy[i] = bytestream_get_byte(&s->buf); }