summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-20 15:12:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-20 15:14:12 +0100
commit07a866282f08985c65c47ebabcf7b20f1c46daa0 (patch)
tree6907f2210ac0712065a38dbb809548047e02e1d9 /libavformat
parent99a30ad56d6a6b5102e894e1929c0929e2f516cf (diff)
oggdec: fix memleak on header parsing failure
Fixes Ticket1931 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/oggdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 0fce8986b1..3ca33dcb63 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -57,6 +57,7 @@ static const struct ogg_codec * const ogg_codecs[] = {
};
static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts);
+static int ogg_read_close(AVFormatContext *s);
//FIXME We could avoid some structure duplication
static int ogg_save(AVFormatContext *s)
@@ -596,8 +597,10 @@ static int ogg_read_header(AVFormatContext *s)
//linear headers seek from start
do {
ret = ogg_packet(s, NULL, NULL, NULL, NULL);
- if (ret < 0)
+ if (ret < 0) {
+ ogg_read_close(s);
return ret;
+ }
} while (!ogg->headers);
av_dlog(s, "found headers\n");