diff mbox series

[FFmpeg-devel,4/6] lavf/codec2: Multiple of block_align -> not corrupt

Message ID 49e2ef1014e935c76b2bc761bd899a2a8dcd1382.camel@haerdin.se
State New
Headers show
Series [FFmpeg-devel,1/6] lavc/codec2utils: Use actual libcodec2 version | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Tomas Härdin Dec. 28, 2023, 6:44 p.m. UTC

diff mbox series

Patch

From a79157b3353f4978e25bb1140391c603de9028bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
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