Skip to content

Commit

Permalink
Merge commit 'ec524ed12aa1aeb37125203f1adf5aa10dfcb0de'
Browse files Browse the repository at this point in the history
* commit 'ec524ed12aa1aeb37125203f1adf5aa10dfcb0de':
  tta: Fix framepos and start_offset types

Conflicts:
	libavformat/tta.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Feb 3, 2015
2 parents 1dc1c4e + ec524ed commit bd12634
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libavformat/tta.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bd12634

Please sign in to comment.