Commit 07a86628 authored by Michael Niedermayer's avatar Michael Niedermayer

oggdec: fix memleak on header parsing failure

Fixes Ticket1931
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 99a30ad5
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment