--- libavformat/oggparsevorbis.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 18b2982..d681684 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; @@ -120,9 +120,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, if (!tt || !ct) { av_freep(&tt); av_freep(&ct); - av_log(as, AV_LOG_WARNING, - "out-of-memory error. skipping VorbisComment tag.\n"); - continue; + return AVERROR(ENOMEM); } for (j = 0; j < tl; j++) @@ -139,8 +137,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, if (!pict) { av_freep(&tt); av_freep(&ct); - av_log(as, AV_LOG_WARNING, "out-of-memory error. Skipping cover art block.\n"); - continue; + return AVERROR(ENOMEM); } if ((ret = av_base64_decode(pict, ct, vl)) > 0) ret = ff_flac_parse_picture(as, pict, ret); @@ -149,7 +146,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, av_freep(&pict); if (ret < 0) { av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n"); - continue; + return ret; } } else if (!ogm_chapter(as, tt, ct)) av_dict_set(m, tt, ct, @@ -245,14 +242,14 @@ static int vorbis_header(AVFormatContext *s, int idx) 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); @@ -263,10 +260,10 @@ static int vorbis_header(AVFormatContext *s, int idx) int srate; if (os->psize != 30) - return -1; + return AVERROR_INVALIDDATA; if (bytestream_get_le32(&p) != 0) /* vorbis_version */ - return -1; + return AVERROR_INVALIDDATA; st->codec->channels = bytestream_get_byte(&p); srate = bytestream_get_le32(&p); @@ -279,12 +276,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; -- 1.7.9.5 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel