Skip to content
Snippets Groups Projects
Commit 1bb3b90d authored by James Almer's avatar James Almer
Browse files

avcodec/pngdec: use av_mod_uintp2

parent 8514f6dc
No related branches found
No related tags found
No related merge requests found
...@@ -787,7 +787,7 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s, ...@@ -787,7 +787,7 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s,
for (i = 0; i < length / 2; i++) { for (i = 0; i < length / 2; i++) {
/* only use the least significant bits */ /* only use the least significant bits */
v = bytestream2_get_be16(&s->gb) & ((1 << s->bit_depth) - 1); v = av_mod_uintp2(bytestream2_get_be16(&s->gb), s->bit_depth);
if (s->bit_depth > 8) if (s->bit_depth > 8)
AV_WB16(&s->transparent_color_be[2 * i], v); AV_WB16(&s->transparent_color_be[2 * i], v);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment