Commit d6ea59b8 authored by Paul B Mahol's avatar Paul B Mahol

tta: datalen is unsigned integer per reference library

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 364c60bf
......@@ -44,8 +44,9 @@ static int tta_read_header(AVFormatContext *s)
{
TTAContext *c = s->priv_data;
AVStream *st;
int i, channels, bps, samplerate, datalen;
int i, channels, bps, samplerate;
uint64_t framepos, start_offset;
uint32_t datalen;
if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))
ff_id3v1_read(s);
......@@ -64,9 +65,9 @@ static int tta_read_header(AVFormatContext *s)
}
datalen = avio_rl32(s->pb);
if(datalen < 0){
av_log(s, AV_LOG_ERROR, "nonsense datalen\n");
return -1;
if (!datalen) {
av_log(s, AV_LOG_ERROR, "invalid datalen\n");
return AVERROR_INVALIDDATA;
}
avio_skip(s->pb, 4); // header crc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment