Merge commit '89b51b570daa80e6e3790fcd449fe61fc5574e07'
* commit '89b51b570daa80e6e3790fcd449fe61fc5574e07': 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 07a866282f08985c65c47ebabcf7b20f1c46daa0 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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2db8660f09
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user