提交 eec26b59 编写于 作者: A Andreas Rheinhardt 提交者: James Almer

avformat/matroskadec: avcodec/tta: Set extradata_size to 22

Up until c4e0e314, the seek table has been included in the tta
extradata, so that the size of said extradata was 22 (the size of a TTA1
header) + 4 * number of frames. The decoder rejected anything below a
size of 30 and so the Matroska demuxer exported 30 byte long extradata,
of which only 18 were set (it ignores a CRC-32 and simply leaves it at
0). But this is unnecessary since said commit, so reduce the size to 22.

Furthermore, replace 30 by 22 in a comment about the extradata size in
libavcodec/tta.c.
Signed-off-by: NAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: NJames Almer <jamrial@gmail.com>
上级 f7bf59b4
...@@ -129,7 +129,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) ...@@ -129,7 +129,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->avctx = avctx; s->avctx = avctx;
// 30bytes includes TTA1 header // 22 bytes for a TTA1 header
if (avctx->extradata_size < 22) if (avctx->extradata_size < 22)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
......
...@@ -2558,7 +2558,7 @@ static int matroska_parse_tracks(AVFormatContext *s) ...@@ -2558,7 +2558,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
} }
if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX) if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
extradata_size = 30; extradata_size = 22;
extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata) if (!extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册