avcodec/proresdec_lgpl: use av_mod_uintp2
authorJames Almer <jamrial@gmail.com>
Mon, 18 Jan 2016 21:37:55 +0000 (18:37 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 29 Jan 2016 22:58:44 +0000 (19:58 -0300)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/proresdec_lgpl.c

index 9e5674e..467a423 100644 (file)
@@ -251,7 +251,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
                       (1 << (4 + ctx->frame->interlaced_frame)) - 1) >>
                      (4 + ctx->frame->interlaced_frame);
 
-    remainder    = ctx->num_x_mbs & ((1 << slice_width_factor) - 1);
+    remainder    = av_mod_uintp2(ctx->num_x_mbs, slice_width_factor);
     num_x_slices = (ctx->num_x_mbs >> slice_width_factor) + (remainder & 1) +
                    ((remainder >> 1) & 1) + ((remainder >> 2) & 1);