X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fproresdec_lgpl.c;h=467a423f232f1271a897f2a69f9fb8494e7268c1;hb=6bff2b5f6a3dca43bf553866b0f110c47d4ec72d;hp=9e5674eccc7eeb5219f66d270a019224034f0245;hpb=b5513441e477f63e9627ce6eb7c4cad475a4ba35;p=ffmpeg diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index 9e5674eccc7..467a423f232 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -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);