avutil/avstring: Do not print NULL
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Jun 2015 13:57:32 +0000 (15:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Jun 2015 16:40:49 +0000 (18:40 +0200)
Fixes segfault
Fixes Ticket4452

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52e02a9e59f83ede84363d0f035389e44357d4a5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/avstring.c

index f785816..5fa295d 100644 (file)
@@ -502,7 +502,7 @@ int main(void)
     printf("Testing av_append_path_component()\n");
     #define TEST_APPEND_PATH_COMPONENT(path, component, expected) \
         fullpath = av_append_path_component((path), (component)); \
-        printf("%s = %s\n", fullpath, expected); \
+        printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
         av_free(fullpath);
     TEST_APPEND_PATH_COMPONENT(NULL, NULL, "(null)")
     TEST_APPEND_PATH_COMPONENT("path", NULL, "path");