summaryrefslogtreecommitdiff
path: root/libavformat/tta.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-03 23:49:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-03 23:49:14 +0100
commitbd12634d6b83e196515c52ccaa9b7513c1023b6f (patch)
treef8bf3873887649509ab0660dea8ff2436cfd8ecb /libavformat/tta.c
parent1dc1c4e7a82edb13420f064890fbde3751ca18c9 (diff)
parentec524ed12aa1aeb37125203f1adf5aa10dfcb0de (diff)
downloadffmpeg-bd12634d6b83e196515c52ccaa9b7513c1023b6f.tar.gz
Merge commit 'ec524ed12aa1aeb37125203f1adf5aa10dfcb0de'
* commit 'ec524ed12aa1aeb37125203f1adf5aa10dfcb0de': tta: Fix framepos and start_offset types Conflicts: libavformat/tta.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r--libavformat/tta.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c
index d3b3fb0471..5789e5b4b8 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -56,12 +56,14 @@ static int tta_read_header(AVFormatContext *s)
TTAContext *c = s->priv_data;
AVStream *st;
int i, channels, bps, samplerate;
- uint64_t framepos, start_offset;
+ int64_t framepos, start_offset;
uint32_t nb_samples, crc;
ff_id3v1_read(s);
start_offset = avio_tell(s->pb);
+ if (start_offset < 0)
+ return start_offset;
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
if (avio_rl32(s->pb) != AV_RL32("TTA1"))
return AVERROR_INVALIDDATA;
@@ -107,7 +109,10 @@ static int tta_read_header(AVFormatContext *s)
st->start_time = 0;
st->duration = nb_samples;
- framepos = avio_tell(s->pb) + 4*c->totalframes + 4;
+ framepos = avio_tell(s->pb);
+ if (framepos < 0)
+ return framepos;
+ framepos += 4 * c->totalframes + 4;
if (ff_alloc_extradata(st->codec, avio_tell(s->pb) - start_offset))
return AVERROR(ENOMEM);