mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 18:25:03 +00:00
argh, who commited this trash
start must be 0 ... Originally committed as revision 8563 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
8ec491e3fd
commit
09a628662d
@ -40,9 +40,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
{
|
{
|
||||||
TTAContext *c = s->priv_data;
|
TTAContext *c = s->priv_data;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
int i, channels, bps, samplerate, datalen, framelen, start;
|
int i, channels, bps, samplerate, datalen, framelen;
|
||||||
|
|
||||||
start = url_ftell(&s->pb);
|
|
||||||
|
|
||||||
if (get_le32(&s->pb) != ff_get_fourcc("TTA1"))
|
if (get_le32(&s->pb) != ff_get_fourcc("TTA1"))
|
||||||
return -1; // not tta file
|
return -1; // not tta file
|
||||||
@ -90,14 +88,14 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
st->codec->sample_rate = samplerate;
|
st->codec->sample_rate = samplerate;
|
||||||
st->codec->bits_per_sample = bps;
|
st->codec->bits_per_sample = bps;
|
||||||
|
|
||||||
st->codec->extradata_size = url_ftell(&s->pb) - start;
|
st->codec->extradata_size = url_ftell(&s->pb);
|
||||||
if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
|
if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
|
||||||
//this check is redundant as get_buffer should fail
|
//this check is redundant as get_buffer should fail
|
||||||
av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
|
av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
|
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
url_fseek(&s->pb, start, SEEK_SET); // or SEEK_CUR and -size ? :)
|
url_fseek(&s->pb, 0, SEEK_SET);
|
||||||
get_buffer(&s->pb, st->codec->extradata, st->codec->extradata_size);
|
get_buffer(&s->pb, st->codec->extradata, st->codec->extradata_size);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user