[FFmpeg-cvslog] ffprobe: Consider the chosen separator when doing CSV escaping

Alexander Strasser git at videolan.org
Tue Sep 25 01:38:21 CEST 2012


ffmpeg | branch: master | Alexander Strasser <eclipse7 at gmx.net> | Mon Sep 17 01:51:53 2012 +0200| [dde8068856c19df4c6f5c75522cff2abeb9362b1] | committer: Alexander Strasser

ffprobe: Consider the chosen separator when doing CSV escaping

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>

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

 ffprobe.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffprobe.c b/ffprobe.c
index ad94995..367b3ca 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -567,7 +567,8 @@ static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep,
  */
 static const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 {
-    int needs_quoting = !!src[strcspn(src, "\",\n\r")];
+    char meta_chars[] = { sep, '"', '\n', '\r', '\0' };
+    int needs_quoting = !!src[strcspn(src, meta_chars)];
 
     if (needs_quoting)
         av_bprint_chars(dst, '\"', 1);



More information about the ffmpeg-cvslog mailing list