From d3807467b2587ea720f32933d44b9dac5ecda66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Zumer?= Date: Wed, 2 Oct 2019 09:04:59 -0400 Subject: [PATCH] avformat/ivfenc: Change the length fields to 32 bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no change in the encoded bitstream, but this ensures that the written field length is consistent with the reference implementation. Unused bytes are zeroed out for backwards compatibility. Signed-off-by: Raphaƫl Zumer --- libavformat/ivfenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c index ae461a872b..eb70421c44 100644 --- a/libavformat/ivfenc.c +++ b/libavformat/ivfenc.c @@ -84,7 +84,8 @@ static int ivf_write_trailer(AVFormatContext *s) avio_seek(pb, 24, SEEK_SET); // overwrite the "length" field (duration) - avio_wl64(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1)); + avio_wl32(pb, ctx->frame_cnt * ctx->sum_delta_pts / (ctx->frame_cnt - 1)); + avio_wl32(pb, 0); // zero out unused bytes avio_seek(pb, end, SEEK_SET); }