Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-29 23:01:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-19 18:05:33 +0300
commitc8707c105fc7cf3cd2ca59a5f2e645d129369d98 (patch)
tree2a2d88f6ff6f3540eea1faafa70c48bab4b2ef7a /libavformat/aptxdec.c
parent9d10d3a4ee7ccf3742c4d9dd26a781aaf2ab8ae9 (diff)
avformat/aptxdec: Don't set AV_PKT_FLAG_CORRUPT mistakenly
Just because we try to put multiple units of block_align bytes (the atomic units for APTX and APTX HD) into one packet does not mean that packets with fewer units than the one we wanted are corrupt; only those packets that are not a multiple of block_align are. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/aptxdec.c')
-rw-r--r--libavformat/aptxdec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/aptxdec.c b/libavformat/aptxdec.c
index aa86bfe330..0637a8afde 100644
--- a/libavformat/aptxdec.c
+++ b/libavformat/aptxdec.c
@@ -74,12 +74,18 @@ static int aptx_hd_read_header(AVFormatContext *s)
static int aptx_read_packet(AVFormatContext *s, AVPacket *pkt)
{
- return av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
+ int ret = av_get_packet(s->pb, pkt, APTX_PACKET_SIZE);
+ if (ret >= 0 && !(ret % APTX_BLOCK_SIZE))
+ pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
+ return ret >= 0 ? 0 : ret;
}
static int aptx_hd_read_packet(AVFormatContext *s, AVPacket *pkt)
{
- return av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
+ int ret = av_get_packet(s->pb, pkt, APTX_HD_PACKET_SIZE);
+ if (ret >= 0 && !(ret % APTX_HD_BLOCK_SIZE))
+ pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
+ return ret >= 0 ? 0 : ret;
}
static const AVOption aptx_options[] = {