[FFmpeg-cvslog] lavu/parseutils: fix av_small_strptime() whitespace directive parsing

Stefano Sabatini git at videolan.org
Mon Sep 17 12:48:56 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Sep 16 15:22:31 2012 +0200| [85c93d90dfae17d2ccff21aec5a55ca3029be83c] | committer: Stefano Sabatini

lavu/parseutils: fix av_small_strptime() whitespace directive parsing

According to POSIX, strptime() should consume whitespaces in the date
string everytime a whitespace conversion specification is found in the
date format specification. Make av_small_strptime() conform with this
behavior.

In particular, should fix trac ticket #1739.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85c93d90dfae17d2ccff21aec5a55ca3029be83c
---

 libavutil/parseutils.c |    6 ++++++
 libavutil/version.h    |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 2440d27..8dc583c 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -443,6 +443,12 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
     int c, val;
 
     for(;;) {
+        /* consume time string until a non whitespace char is found */
+        while (isspace(*fmt)) {
+            while (isspace(*p))
+                p++;
+            fmt++;
+        }
         c = *fmt++;
         if (c == '\0') {
             return (char *)p;
diff --git a/libavutil/version.h b/libavutil/version.h
index ac2c09d..3361069 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -40,7 +40,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR 51
 #define LIBAVUTIL_VERSION_MINOR 73
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list