diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-04 12:33:50 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-04 12:33:50 +0400 |
commit | 23a7c32a7ade12044c600aa48966829c53dcc836 (patch) | |
tree | 8e5fd9fad7eceefd96095525b47af077cef4cf38 /libavformat/wavdec.c | |
parent | 0104570fb65bef9986a630e0188b3756295693a9 (diff) | |
parent | 69467fb64ba4972c7aa436ded2468bb32df9fa97 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
wav: return meaningful errors
Conflicts:
libavformat/wavdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r-- | libavformat/wavdec.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index b2d28b8c87..74dbbff7f4 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -69,7 +69,7 @@ static int64_t find_tag(AVIOContext *pb, uint32_t tag1) for (;;) { if (url_feof(pb)) - return -1; + return AVERROR_EOF; size = next_tag(pb, &tag); if (tag == tag1) break; @@ -243,18 +243,18 @@ static int wav_read_header(AVFormatContext *s) rf64 = tag == MKTAG('R', 'F', '6', '4'); if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F')) - return -1; + return AVERROR_INVALIDDATA; avio_rl32(pb); /* file size */ tag = avio_rl32(pb); if (tag != MKTAG('W', 'A', 'V', 'E')) - return -1; + return AVERROR_INVALIDDATA; if (rf64) { if (avio_rl32(pb) != MKTAG('d', 's', '6', '4')) - return -1; + return AVERROR_INVALIDDATA; size = avio_rl32(pb); if (size < 24) - return -1; + return AVERROR_INVALIDDATA; avio_rl64(pb); /* RIFF size */ data_size = avio_rl64(pb); @@ -405,12 +405,12 @@ static int64_t find_guid(AVIOContext *pb, const uint8_t guid1[16]) avio_read(pb, guid, 16); size = avio_rl64(pb); if (size <= 24) - return -1; + return AVERROR_INVALIDDATA; if (!memcmp(guid, guid1, 16)) return size; avio_skip(pb, FFALIGN(size, INT64_C(8)) - 24); } - return -1; + return AVERROR_EOF; } #define MAX_SIZE 4096 @@ -590,16 +590,16 @@ static int w64_read_header(AVFormatContext *s) avio_read(pb, guid, 16); if (memcmp(guid, ff_w64_guid_riff, 16)) - return -1; + return AVERROR_INVALIDDATA; /* riff + wave + fmt + sizes */ if (avio_rl64(pb) < 16 + 8 + 16 + 8 + 16 + 8) - return -1; + return AVERROR_INVALIDDATA; avio_read(pb, guid, 16); if (memcmp(guid, ff_w64_guid_wave, 16)) { av_log(s, AV_LOG_ERROR, "could not find wave guid\n"); - return -1; + return AVERROR_INVALIDDATA; } wav->w64 = 1; |