summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/oggdec.c14
-rw-r--r--libavformat/oggparsevorbis.c2
2 files changed, 12 insertions, 4 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 193a286e43..38f60653f9 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -543,7 +543,11 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
os->incomplete = 0;
if (os->header) {
- os->header = os->codec->header(s, idx);
+ if ((ret = os->codec->header(s, idx)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Header processing failed: %s\n", av_err2str(ret));
+ return ret;
+ }
+ os->header = ret;
if (!os->header) {
os->segp = segp;
os->psize = psize;
@@ -574,8 +578,12 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
} else {
os->pflags = 0;
os->pduration = 0;
- if (os->codec && os->codec->packet)
- os->codec->packet(s, idx);
+ if (os->codec && os->codec->packet) {
+ if ((ret = os->codec->packet(s, idx)) < 0) {
+ av_log(s, AV_LOG_ERROR, "Packet processing failed: %s\n", av_err2str(ret));
+ return ret;
+ }
+ }
if (sid)
*sid = idx;
if (dstart)
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 65b1998a02..29b1ab514e 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -317,7 +317,7 @@ static int vorbis_header(AVFormatContext *s, int idx)
if (priv->packet[pkt_type >> 1])
return AVERROR_INVALIDDATA;
if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])
- return AVERROR_INVALIDDATA;
+ return priv->vp ? 0 : AVERROR_INVALIDDATA;
priv->len[pkt_type >> 1] = os->psize;
priv->packet[pkt_type >> 1] = av_mallocz(os->psize);