summaryrefslogtreecommitdiff
path: root/libavformat/webmdashenc.c
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2015-04-14 10:54:23 -0700
committerMichael Niedermayer <michaelni@gmx.at>2015-04-14 20:48:30 +0200
commit30e2f87d2eac8f7d932698b344b32617c05e73f4 (patch)
tree4ab11eb91486997a1dd7f427b27d70d100e02e03 /libavformat/webmdashenc.c
parentee69229dd806709a51b70184640c2f298cd99d2b (diff)
webdashenc: replace unchecked av_malloc with stack allocation
Replace an unchecked av_malloc call with stack allocation as the size is always a constant. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/webmdashenc.c')
-rw-r--r--libavformat/webmdashenc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index c5347a98e4..c5d715851f 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -109,7 +109,7 @@ static void write_header(AVFormatContext *s)
time_t local_time = time(NULL);
struct tm gmt_buffer;
struct tm *gmt = gmtime_r(&local_time, &gmt_buffer);
- char *gmt_iso = av_malloc(21);
+ char gmt_iso[21];
strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt);
if (w->debug_mode) {
av_strlcpy(gmt_iso, "", 1);
@@ -122,7 +122,6 @@ static void write_header(AVFormatContext *s)
w->utc_timing_url ? "urn:mpeg:dash:utc:http-iso:2014" : "urn:mpeg:dash:utc:direct:2012");
avio_printf(s->pb, " value=\"%s\"/>\n",
w->utc_timing_url ? w->utc_timing_url : gmt_iso);
- av_free(gmt_iso);
}
}