diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-05 20:18:04 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-05 20:18:04 +0000 |
commit | 0aabd35b62f6e65c1b0395a8573f88920030c5b7 (patch) | |
tree | 26099183dfcbcd166b6256a13b068a45c3e652f5 /libavformat/dxa.c | |
parent | c5008135c2ec10db071ff914be4f296656eb6ccc (diff) | |
download | ffmpeg-0aabd35b62f6e65c1b0395a8573f88920030c5b7.tar.gz |
lavf/dxa: return meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/dxa.c')
-rw-r--r-- | libavformat/dxa.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/dxa.c b/libavformat/dxa.c index 6c76ab8b40..22ee2a97a5 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -65,12 +65,12 @@ static int dxa_read_header(AVFormatContext *s) tag = avio_rl32(pb); if (tag != MKTAG('D', 'E', 'X', 'A')) - return -1; + return AVERROR_INVALIDDATA; flags = avio_r8(pb); c->frames = avio_rb16(pb); if(!c->frames){ av_log(s, AV_LOG_ERROR, "File contains no frames ???\n"); - return -1; + return AVERROR_INVALIDDATA; } fps = avio_rb32(pb); @@ -90,7 +90,7 @@ static int dxa_read_header(AVFormatContext *s) st = avformat_new_stream(s, NULL); if (!st) - return -1; + return AVERROR(ENOMEM); // Parse WAV data header if(avio_rl32(pb) == MKTAG('W', 'A', 'V', 'E')){ @@ -103,7 +103,7 @@ static int dxa_read_header(AVFormatContext *s) ast = avformat_new_stream(s, NULL); if (!ast) - return -1; + return AVERROR(ENOMEM); ret = ff_get_wav_header(pb, ast->codec, fsize); if (ret < 0) return ret; @@ -191,7 +191,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) size = AV_RB32(buf + 5); if(size > 0xFFFFFF){ av_log(s, AV_LOG_ERROR, "Frame size is too big: %d\n", size); - return -1; + return AVERROR_INVALIDDATA; } if(av_new_packet(pkt, size + DXA_EXTRA_SIZE + pal_size) < 0) return AVERROR(ENOMEM); @@ -209,7 +209,7 @@ static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; default: av_log(s, AV_LOG_ERROR, "Unknown tag %c%c%c%c\n", buf[0], buf[1], buf[2], buf[3]); - return -1; + return AVERROR_INVALIDDATA; } } return AVERROR_EOF; |