summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-11-11 14:37:48 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-11-11 14:37:48 +0100
commit611c22140a54db0baa863b26368e12d3a1d8267e (patch)
tree559b65b68d30e12abfb199277b6119c58df81627 /libavformat/utils.c
parentc03ffe1712e65b2f18d090d34db95ef18340bd0e (diff)
parent8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8 (diff)
Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'
* commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8': lavf: deprecate compute_pkt_fields2 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6b426e9492..251b2c66e6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3669,6 +3669,8 @@ static void free_stream(AVStream **pst)
if (st->attached_pic.data)
av_packet_unref(&st->attached_pic);
+ av_freep(&st->internal);
+
av_dict_free(&st->metadata);
av_freep(&st->probe_data.buf);
av_freep(&st->index_entries);
@@ -3785,6 +3787,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
av_free(st);
return NULL;
}
+
+ st->internal = av_mallocz(sizeof(*st->internal));
+ if (!st->internal)
+ goto fail;
+
if (s->iformat) {
/* no default bitrate if decoding */
st->codec->bit_rate = 0;
@@ -3825,6 +3832,9 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
s->streams[s->nb_streams++] = st;
return st;
+fail:
+ free_stream(&st);
+ return NULL;
}
AVProgram *av_new_program(AVFormatContext *ac, int id)