On Sat, Jun 14, 2014 at 03:15:54PM +0530, Nidhi Makhijani wrote:
> --- a/libavformat/rmdec.c
> +++ b/libavformat/rmdec.c
> @@ -417,6 +422,10 @@ static int rm_read_header_old(AVFormatContext *s)
> st->priv_data = ff_rm_alloc_rmstream();
> + if (!st->priv_data) {
> + avformat_free_context(s);
> + return AVERROR(ENOMEM);
> + }
> return rm_read_audio_stream_info(s, s->pb, st, st->priv_data, 1);
> @@ -494,9 +503,16 @@ static int rm_read_header(AVFormatContext *s)
> st->priv_data = ff_rm_alloc_rmstream();
> + if (!st->priv_data) {
> + avformat_free_context(s);
> + return AVERROR(ENOMEM);
> + }
> if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data,
> - avio_rb32(pb)) < 0)
> + avio_rb32(pb)) < 0) {
> + ff_rm_free_rmstream(st->priv_data);
> + avformat_free_context(s);
> return -1;
> + }
I don't think you should be freeing all those contexts.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel