aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/oggdec.c
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2017-11-28 13:40:20 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-02 19:14:23 +0100
commit09494d098405738a5972e0052110af65b3ff7e72 (patch)
tree94d0065cdf42ceded0905ef870148d67e4d06567 /libavformat/oggdec.c
parent53c492640c6b4690715793372454194379093d21 (diff)
downloadffmpeg-09494d098405738a5972e0052110af65b3ff7e72.tar.gz
avformat/oggdec: Respect AVERROR codes returned by ogg parsers.
Fixes ticket #6804. All of the ogg header and packet parsers may return standard AVERROR codes; these return values should not be treated as success. Additionally changes oggparsevorbis, to not give up too early with certain types of poorly muxed files. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r--libavformat/oggdec.c14
1 files changed, 11 insertions, 3 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)