[FFmpeg-cvslog] avcodec/pngdec: use av_mod_uintp2

James Almer git at videolan.org
Sat Jan 30 00:00:21 CET 2016


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Jan 18 18:37:36 2016 -0300| [1bb3b90db8332dfc387c7bfecb98e53583596de1] | committer: James Almer

avcodec/pngdec: use av_mod_uintp2

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1bb3b90db8332dfc387c7bfecb98e53583596de1
---

 libavcodec/pngdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 3059087..61857d0 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -787,7 +787,7 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s,
 
         for (i = 0; i < length / 2; i++) {
             /* 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)
                 AV_WB16(&s->transparent_color_be[2 * i], v);



More information about the ffmpeg-cvslog mailing list