aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/omadec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-04-17 11:41:54 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-05-07 14:37:32 +0200
commit6f98508e2b86dcb79614d8c9b8e97c5e83a21cb0 (patch)
tree0171a847161ee03b330a63035c8cce47a42b7d05 /libavformat/omadec.c
parente55e8b2c362a60bad66929d83d8c83b0d7f5ffc9 (diff)
downloadffmpeg-6f98508e2b86dcb79614d8c9b8e97c5e83a21cb0.tar.gz
oma: return meaningful errors
Diffstat (limited to 'libavformat/omadec.c')
-rw-r--r--libavformat/omadec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 4f9c49f611..06b6bc6966 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -200,13 +200,13 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
}
if (!em) {
av_log(s, AV_LOG_ERROR, "No encryption header found\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if (geob->datasize < 64) {
av_log(s, AV_LOG_ERROR,
"Invalid GEOB data size: %u\n", geob->datasize);
- return -1;
+ return AVERROR_INVALIDDATA;
}
gdata = geob->data;
@@ -221,7 +221,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
if (memcmp(&gdata[OMA_ENC_HEADER_SIZE], "KEYRING ", 12)) {
av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
oc->rid = AV_RB32(&gdata[OMA_ENC_HEADER_SIZE + 28]);
av_log(s, AV_LOG_DEBUG, "RID: %.8x\n", oc->rid);
@@ -251,7 +251,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
}
if (i >= sizeof(leaf_table)) {
av_log(s, AV_LOG_ERROR, "Invalid key\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
}
@@ -286,7 +286,7 @@ static int oma_read_header(AVFormatContext *s)
if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}), 3) ||
buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
oc->content_start = avio_tell(s->pb);
@@ -380,7 +380,7 @@ static int oma_read_header(AVFormatContext *s)
break;
default:
av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n", buf[32]);
- return -1;
+ return AVERROR(ENOSYS);
}
st->codec->block_align = framesize;