diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2017-11-12 04:29:06 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2017-11-12 04:29:06 +0100 |
commit | b998a56b0ac9744537837c668e32487d060be3c0 (patch) | |
tree | 1e9ac5feb272b915f1d538ea4bbb36833755308a | |
parent | 5b5365fe9d635005a9020d89c2448f4b5828d42f (diff) | |
download | ffmpeg-b998a56b0ac9744537837c668e32487d060be3c0.tar.gz |
lavc/jpeg2000dec: Fix used variables reading palette.
Affected files with palette and colour-depth < 8.
-rw-r--r-- | libavcodec/jpeg2000dec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 9a5e64e854..62b9009a82 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -2039,13 +2039,13 @@ static int jp2_find_codestream(Jpeg2000DecoderContext *s) } if (colour_depth[1] <= 8) { g = bytestream2_get_byteu(&s->g) << 8 - colour_depth[1]; - r |= r >> colour_depth[1]; + g |= g >> colour_depth[1]; } else { g = bytestream2_get_be16u(&s->g) >> colour_depth[1] - 8; } if (colour_depth[2] <= 8) { b = bytestream2_get_byteu(&s->g) << 8 - colour_depth[2]; - r |= r >> colour_depth[2]; + b |= b >> colour_depth[2]; } else { b = bytestream2_get_be16u(&s->g) >> colour_depth[2] - 8; } |