Commit 2dac0765 authored by Jan Gerber's avatar Jan Gerber
Browse files

fix json/metadata in --info

parent 5a0a2a1f
FFMPEG_REVISION=20760
FFMPEG_REVISION=20906
FFMPEG_CO_DIR=ffmpeg
FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/trunk
# Because ffmpeg checks out libswscale via an svn:externals, checking
# out an old ffmpeg does not check out a corresponding libswscale.
# Keep the swscale checkout manually synchronized, then. Update this
# when you update FFMPEG_REVISION.
FFMPEG_EXTERNALS_REVISION=29978
FFMPEG_EXTERNALS_REVISION=30099
......@@ -100,7 +100,6 @@ char *replace_str_all(char *str, char *orig, char *rep) {
const char buffer[4096];
char *p, *p_str = str, *p_buffer = (char *)buffer;
int len = strlen(str);
strncpy(p_buffer, str, len);
while (p = strstr(p_str, orig)) {
strncpy(p_buffer, p_str, p-p_str);
......@@ -110,7 +109,8 @@ char *replace_str_all(char *str, char *orig, char *rep) {
p_str = p + strlen(orig);
p_buffer += strlen(rep);
}
p = (char *)buffer;
p = malloc(len+1);
strncpy(p, buffer, len);
p[len] = '\0';
return p;
}
......@@ -139,6 +139,7 @@ void json_add_key_value(FILE *output, char *key, void *value, int type, int last
p = replace_str_all(p, "\\", "\\\\");
p = replace_str_all(p, "\"", "\\\"");
fprintf(output, "\"%s\": \"%s\"", key, p);
free(p);
break;
case JSON_INT:
fprintf(output, "\"%s\": %d", key, *(int *)value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment