Skip to content

Commit

Permalink
lavc/proresdec2: Fix slice_count for very high resolutions.
Browse files Browse the repository at this point in the history
QT ignores the value written in the frame header.
Issue reported by forum user Koracas.
  • Loading branch information
cehoyos committed Oct 30, 2015
1 parent 2f1d6d4 commit bd1d67e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libavcodec/proresdec2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 13
#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_MICRO 102

#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
Expand Down

0 comments on commit bd1d67e

Please sign in to comment.