X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fproresdec2.c;h=2d47a1303064c1e4fdab93fe445666a289bcbea7;hb=352bd18dff147ec1150c32a034046c6420ae1d36;hp=932f85f73b35c203de2fa0ba424351012b84d3d9;hpb=368e5216464fd894ded93e8a3fc12066c1a9c061;p=ffmpeg diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 932f85f73b3..2d47a130306 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -180,7 +180,10 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons else ctx->mb_height = (avctx->height + 15) >> 4; - slice_count = AV_RB16(buf + 5); + // QT ignores the written value + // slice_count = AV_RB16(buf + 5); + slice_count = ctx->mb_height * ((ctx->mb_width >> log2_slice_mb_width) + + av_popcount(ctx->mb_width & (1 << log2_slice_mb_width) - 1)); if (ctx->slice_count != slice_count || !ctx->slices) { av_freep(&ctx->slices);