From 6153aa2d1e41212672dfd5543a7bda9079a0160c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u@pkh.me>
Date: Sun, 7 Dec 2014 15:46:17 +0100
Subject: [PATCH] avcodec/jacosubdec: check strftime return value

Fixes CID1257004
---
 libavcodec/jacosubdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c
index 2f949564d50..0c97eb86c06 100644
--- a/libavcodec/jacosubdec.c
+++ b/libavcodec/jacosubdec.c
@@ -46,8 +46,8 @@ static int insert_datetime(AVBPrint *dst, const char *in, const char *arg)
     struct tm ltime;
 
     localtime_r(&now, &ltime);
-    strftime(buf, sizeof(buf), arg, &ltime);
-    av_bprintf(dst, "%s", buf);
+    if (strftime(buf, sizeof(buf), arg, &ltime))
+        av_bprintf(dst, "%s", buf);
     return 0;
 }
 
-- 
GitLab