mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
printf: fix handling of old printf extension specifiers for ABI compatibility
Fixes abort when the old specifiers are used. Fix up the conversion specifier, it would get overwritten with 'c' below to the extension format char, which then later is unhandled, leading to the abort. Also fix up and enable unit test for this. https://bugzilla.gnome.org/process_bug.cgi
This commit is contained in:
parent
c398c842f5
commit
e8a9f7acdf
2 changed files with 14 additions and 6 deletions
|
@ -392,7 +392,7 @@ printf_parse (const char *format, char_directives * d, arguments * a)
|
||||||
type = TYPE_POINTER_EXT;
|
type = TYPE_POINTER_EXT;
|
||||||
dp->flags |= FLAG_PTR_EXT;
|
dp->flags |= FLAG_PTR_EXT;
|
||||||
dp->ptr_ext_char = 'A';
|
dp->ptr_ext_char = 'A';
|
||||||
dp->conversion = 'p';
|
c = 'p';
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
/* Note: cp points already to the char after the 'p' now */
|
/* Note: cp points already to the char after the 'p' now */
|
||||||
|
@ -413,7 +413,7 @@ printf_parse (const char *format, char_directives * d, arguments * a)
|
||||||
type = TYPE_POINTER_EXT;
|
type = TYPE_POINTER_EXT;
|
||||||
dp->flags |= FLAG_PTR_EXT;
|
dp->flags |= FLAG_PTR_EXT;
|
||||||
dp->ptr_ext_char = 'B';
|
dp->ptr_ext_char = 'B';
|
||||||
dp->conversion = 'p';
|
c = 'p';
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
#ifdef HAVE_LONG_LONG
|
#ifdef HAVE_LONG_LONG
|
||||||
|
|
|
@ -290,10 +290,18 @@ GST_START_TEST (info_old_printf_extensions)
|
||||||
fail_unless_equals_int (g_list_length (messages), 1);
|
fail_unless_equals_int (g_list_length (messages), 1);
|
||||||
str = (gchar *) messages->data;
|
str = (gchar *) messages->data;
|
||||||
fail_unless (str != NULL);
|
fail_unless (str != NULL);
|
||||||
fail_unless (strstr (str, "foo/bar") != NULL);
|
|
||||||
fail_unless (strstr (str, "width = (int) 4096") != NULL);
|
GST_INFO ("str = '%s'", str);
|
||||||
fail_unless (strstr (str, "framerate = (fraction) 50/1") != NULL);
|
|
||||||
fail_unless (strstr (str, "time") != NULL);
|
fail_unless (strstr (str, "time") != NULL);
|
||||||
|
fail_unless (strstr (str, "start=0:00:00.000000000") != NULL);
|
||||||
|
fail_unless (strstr (str, "stop=99:99:99.999999999") != NULL);
|
||||||
|
fail_unless (strstr (str, "applied_rate=1.000000") != NULL);
|
||||||
|
|
||||||
|
fail_unless (strstr (str, " caps are ") != NULL);
|
||||||
|
fail_unless (strstr (str, "foo/bar") != NULL);
|
||||||
|
fail_unless (strstr (str, "width=(int)4096") != NULL);
|
||||||
|
fail_unless (strstr (str, "framerate=(fraction)50/1") != NULL);
|
||||||
fail_unless (strstr (str, "ARGB") != NULL);
|
fail_unless (strstr (str, "ARGB") != NULL);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
@ -323,7 +331,7 @@ gst_info_suite (void)
|
||||||
tcase_add_test (tc_chain, info_log_handler);
|
tcase_add_test (tc_chain, info_log_handler);
|
||||||
tcase_add_test (tc_chain, info_dump_mem);
|
tcase_add_test (tc_chain, info_dump_mem);
|
||||||
tcase_add_test (tc_chain, info_fixme);
|
tcase_add_test (tc_chain, info_fixme);
|
||||||
tcase_skip_broken_test (tc_chain, info_old_printf_extensions);
|
tcase_add_test (tc_chain, info_old_printf_extensions);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|
Loading…
Reference in a new issue