aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2017-11-20 12:07:57 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-02 00:28:59 +0100
commit50b22648100e2fa77c798ac770967982d841d04d (patch)
tree15698eda72fde94014520a29add1be535ba37c17
parentc09d587ac54d0ecb8190618fb867e9fd907e1359 (diff)
downloadffmpeg-50b22648100e2fa77c798ac770967982d841d04d.tar.gz
Close ogg stream upon error when using AV_EF_EXPLODE.
Without this there can be multiple memory leaks for unrecognized ogg streams. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit bce8fc0754c4b31f574a4372c6d7996ed29f7c2a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 7ecb42ce8f..99e51b8b65 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -709,8 +709,10 @@ static int ogg_read_header(AVFormatContext *s)
"Headers mismatch for stream %d: "
"expected %d received %d.\n",
i, os->codec->nb_header, os->nb_header);
- if (s->error_recognition & AV_EF_EXPLODE)
+ if (s->error_recognition & AV_EF_EXPLODE) {
+ ogg_read_close(s);
return AVERROR_INVALIDDATA;
+ }
}
if (os->start_granule != OGG_NOGRANULE_VALUE)
os->lastpts = s->streams[i]->start_time =