diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-10-17 13:12:18 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-10-17 15:58:08 +0400 |
commit | d6ea59b8608ddd214b61866bd86e965f62514a0c (patch) | |
tree | 48d42a8488e06f498e370ece30f74a7f40d33f03 /libavformat/tta.c | |
parent | 364c60bf64a21c804b5255e9a2336a59cfae54d8 (diff) |
tta: datalen is unsigned integer per reference library
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r-- | libavformat/tta.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c index 1440c8000a..445389ed95 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -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 |