Commit 2db8660f authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '89b51b57'

* commit '89b51b57':
  oggdec: free the ogg streams on read_header failure

Conflicts:
	libavformat/oggdec.c

Original commit this was based on: (this merge just moves the function up)
commit 07a86628
Author: Michael Niedermayer <michaelni@gmx.at>
Date:   Tue Nov 20 15:12:37 2012 +0100

    oggdec: fix memleak on header parsing failure

    Fixes Ticket1931
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8b4842c2 89b51b57
......@@ -57,7 +57,6 @@ 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)
......@@ -599,6 +598,19 @@ static int ogg_get_length(AVFormatContext *s)
return 0;
}
static int ogg_read_close(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
int i;
for (i = 0; i < ogg->nstreams; i++) {
av_free(ogg->streams[i].buf);
av_free(ogg->streams[i].private);
}
av_free(ogg->streams);
return 0;
}
static int ogg_read_header(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
......@@ -722,19 +734,6 @@ retry:
return psize;
}
static int ogg_read_close(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
int i;
for (i = 0; i < ogg->nstreams; i++) {
av_free(ogg->streams[i].buf);
av_free(ogg->streams[i].private);
}
av_free(ogg->streams);
return 0;
}
static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
int64_t *pos_arg, int64_t pos_limit)
{
......
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