[FFmpeg-devel] [PATCH 2/6] avformat/matroskadec: Reject SIPR flavor > 3
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Sat Dec 7 01:16:18 EET 2019
rmdec does it, too. And it allows to simplify the check for whether one
should use the Real Audio parsing mode.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavformat/matroskadec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 908ad097cb..080a839b6a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2587,6 +2587,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
track->audio.frame_size = avio_rb16(&b);
track->audio.sub_packet_size = avio_rb16(&b);
if (flavor < 0 ||
+ flavor > 3 && codec_id == AV_CODEC_ID_SIPR ||
track->audio.coded_framesize <= 0 ||
track->audio.sub_packet_h <= 0 ||
track->audio.frame_size <= 0 ||
@@ -2600,7 +2601,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
st->codecpar->block_align = track->audio.coded_framesize;
track->codec_priv.size = 0;
} else {
- if (codec_id == AV_CODEC_ID_SIPR && flavor < 4) {
+ if (codec_id == AV_CODEC_ID_SIPR) {
static const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 };
track->audio.sub_packet_size = ff_sipr_subpk_size[flavor];
st->codecpar->bit_rate = sipr_bit_rate[flavor];
@@ -3593,8 +3594,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
for (n = 0; n < laces; n++) {
int64_t lace_duration = block_duration*(n+1) / laces - block_duration*n / laces;
- if (track->audio.buf &&
- st->codecpar->block_align && track->audio.sub_packet_size) {
+ if (track->audio.buf) {
res = matroska_parse_rm_audio(matroska, track, st, data,
lace_size[n],
timecode, pos);
--
2.20.1
More information about the ffmpeg-devel
mailing list