diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-10-30 01:32:39 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-10-30 01:32:39 +0100 |
commit | bd1d67efe830efcdb21af751e9bfd7ef8da42590 (patch) | |
tree | 3faa340d19f208db3ce986198c1ad06367c2b545 /libavcodec/proresdec2.c | |
parent | 2f1d6d45af42fc8bfa4d13afef08ad9465d216cc (diff) |
lavc/proresdec2: Fix slice_count for very high resolutions.
QT ignores the value written in the frame header.
Issue reported by forum user Koracas.
Diffstat (limited to 'libavcodec/proresdec2.c')
-rw-r--r-- | libavcodec/proresdec2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 932f85f73b..2d47a13030 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); |