summaryrefslogtreecommitdiff
path: root/libavcodec/tta.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-05-30 19:57:47 +0000
committerPaul B Mahol <onemda@gmail.com>2013-05-30 20:17:27 +0000
commitc4e0e314248865830ec073e5a3ef08e0a40aabf2 (patch)
tree3d0ea2f8b5a04b6b89dc00175787f4d7b274eda2 /libavcodec/tta.c
parent2886e8065e635141db1df0a5236c2551573babaa (diff)
downloadffmpeg-c4e0e314248865830ec073e5a3ef08e0a40aabf2.tar.gz
tta: remove pointless code
Checking seek table crc in decoder is pointless, as seek table is not used in decoder anyway, so also stop storing seek table into extradata.
Diffstat (limited to 'libavcodec/tta.c')
-rw-r--r--libavcodec/tta.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index fd796d9243..0de3fe96ce 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -203,8 +203,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->avctx = avctx;
- // 30bytes includes a seektable with one frame
- if (avctx->extradata_size < 30)
+ // 30bytes includes TTA1 header
+ if (avctx->extradata_size < 22)
return AVERROR_INVALIDDATA;
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8);
@@ -278,17 +278,6 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
av_log(avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n",
s->data_length, s->frame_length, s->last_frame_length, total_frames);
- // FIXME: seek table
- if (avctx->extradata_size <= 26 || total_frames > INT_MAX / 4 ||
- avctx->extradata_size - 26 < total_frames * 4)
- av_log(avctx, AV_LOG_WARNING, "Seek table missing or too small\n");
- else if (avctx->err_recognition & AV_EF_CRCCHECK) {
- if (tta_check_crc(s, avctx->extradata + 22, total_frames * 4))
- return AVERROR_INVALIDDATA;
- }
- skip_bits_long(&s->gb, 32 * total_frames);
- skip_bits_long(&s->gb, 32); // CRC32 of seektable
-
if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
return AVERROR_INVALIDDATA;