summaryrefslogtreecommitdiff
path: root/libavformat/tta.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-03 22:26:16 +0000
committerPaul B Mahol <onemda@gmail.com>2013-06-03 22:26:16 +0000
commit0e84ba747efae172c7d95c8c05e5baefafe345d9 (patch)
tree99b02e1a7ae9f6f37915bf487b9b0ac7dca3dc24 /libavformat/tta.c
parentb4d4ef55294fcf0da6fa8eda2a1be4bdabf7b41c (diff)
tta: return meaningful error codrs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r--libavformat/tta.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c
index f6b8a88f82..7db1a90a1b 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -64,7 +64,7 @@ static int tta_read_header(AVFormatContext *s)
start_offset = avio_tell(s->pb);
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
if (avio_rl32(s->pb) != AV_RL32("TTA1"))
- return -1; // not tta file
+ return AVERROR_INVALIDDATA;
avio_skip(s->pb, 2); // FIXME: flags
channels = avio_rl16(s->pb);
@@ -72,7 +72,7 @@ static int tta_read_header(AVFormatContext *s)
samplerate = avio_rl32(s->pb);
if(samplerate <= 0 || samplerate > 1000000){
av_log(s, AV_LOG_ERROR, "nonsense samplerate\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
datalen = avio_rl32(s->pb);
@@ -96,7 +96,7 @@ static int tta_read_header(AVFormatContext *s)
if(c->totalframes >= UINT_MAX/sizeof(uint32_t) || c->totalframes <= 0){
av_log(s, AV_LOG_ERROR, "totalframes %d invalid\n", c->totalframes);
- return -1;
+ return AVERROR_INVALIDDATA;
}
st = avformat_new_stream(s, NULL);