diff mbox series

[FFmpeg-devel,v2,5/7] lavf/codec2: Multiple of block_align -> not corrupt

Message ID 79aa03ff5453a66eebc6df6cda93463aa64dd71a.camel@haerdin.se
State New
Headers show
Series [FFmpeg-devel,v2,1/7] 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. 30, 2023, 9:25 p.m. UTC

diff mbox series

Patch

From 743666602cd9f6f213b81e3bbc8a3547b518db41 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 5/7] 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 8299302acc..7447109752 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