OSDN Git Service

avcodec/jacosubdec: check strftime return value
authorClément Bœsch <u@pkh.me>
Sun, 7 Dec 2014 14:46:17 +0000 (15:46 +0100)
committerClément Bœsch <u@pkh.me>
Sun, 7 Dec 2014 14:46:17 +0000 (15:46 +0100)
Fixes CID1257004

libavcodec/jacosubdec.c

index 2f94956..0c97eb8 100644 (file)
@@ -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;
 }