aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-06 12:24:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-06 12:24:13 +0200
commit4634871b513cc3eef74087e04ce0c542bdd2c393 (patch)
treebd833c6e6ce3178088cd5f3af6c4e279ecd52267
parentc86955d24a4311721bf72cce21ebb14460a02ef9 (diff)
parent90e15e340d97aebb5d2318020b5a516804d4c7c1 (diff)
downloadffmpeg-4634871b513cc3eef74087e04ce0c542bdd2c393.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: oggparsevorbis: return meaningful errors Conflicts: libavformat/oggparsevorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/oggparsevorbis.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index da35ff2511..67b3460df0 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -80,12 +80,12 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
/* must have vendor_length and user_comment_list_length */
if (size < 8)
- return -1;
+ return AVERROR_INVALIDDATA;
s = bytestream_get_le32(&p);
if (end - p - 4 < s || s < 0)
- return -1;
+ return AVERROR_INVALIDDATA;
p += s;
@@ -244,21 +244,21 @@ static int vorbis_header(AVFormatContext *s, int idx)
if (!os->private) {
os->private = av_mallocz(sizeof(struct oggvorbis_private));
if (!os->private)
- return -1;
+ return AVERROR(ENOMEM);
}
if (!(pkt_type & 1))
return 0;
if (os->psize < 1 || pkt_type > 5)
- return -1;
+ return AVERROR_INVALIDDATA;
priv = os->private;
if (priv->packet[pkt_type >> 1])
- return -1;
+ return AVERROR_INVALIDDATA;
if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])
- return -1;
+ return AVERROR_INVALIDDATA;
priv->len[pkt_type >> 1] = os->psize;
priv->packet[pkt_type >> 1] = av_mallocz(os->psize);
@@ -272,10 +272,10 @@ static int vorbis_header(AVFormatContext *s, int idx)
int channels;
if (os->psize != 30)
- return -1;
+ return AVERROR_INVALIDDATA;
if (bytestream_get_le32(&p) != 0) /* vorbis_version */
- return -1;
+ return AVERROR_INVALIDDATA;
channels = bytestream_get_byte(&p);
if (st->codec->channels && channels != st->codec->channels) {
@@ -293,12 +293,12 @@ static int vorbis_header(AVFormatContext *s, int idx)
bs1 = blocksize >> 4;
if (bs0 > bs1)
- return -1;
+ return AVERROR_INVALIDDATA;
if (bs0 < 6 || bs1 > 13)
- return -1;
+ return AVERROR_INVALIDDATA;
if (bytestream_get_byte(&p) != 1) /* framing_flag */
- return -1;
+ return AVERROR_INVALIDDATA;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_VORBIS;