From a79157b3353f4978e25bb1140391c603de9028bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Wed, 27 Dec 2023 22:50:18 +0100 Subject: [PATCH 4/6] lavf/codec2: Multiple of block_align -> not corrupt --- libavformat/codec2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/codec2.c b/libavformat/codec2.c index 162b844897..b0c76714bc 100644 --- a/libavformat/codec2.c +++ b/libavformat/codec2.c @@ -223,6 +223,11 @@ static int codec2_read_packet(AVFormatContext *s, AVPacket *pkt) n = ret / block_align; pkt->duration = n * frame_size; + //un-mark packet as corrupt if size is a multiple of block_align + //this can happen when frames_per_packet > 1 + if (ret % block_align == 0) + pkt->flags &= ~AV_PKT_FLAG_CORRUPT; + return ret; } -- 2.39.2