From e5b4e30baab2378e9bb63550b815ff923bf8c806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 6 May 2014 07:51:11 +0100 Subject: [PATCH] examples: playback-test: fix crashes when setting buffer-size playbin's buffer-size property takes a gint, not a gint64, so only pass the bits expected to the vararg function, or the terminator might not be found, leading to crashes, esp. with negative numbers. Spotted by Ravi Kiran K N https://bugzilla.gnome.org/show_bug.cgi?id=729617 --- tests/examples/playback/playback-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/examples/playback/playback-test.c b/tests/examples/playback/playback-test.c index e39a5df4de..81d2824e25 100644 --- a/tests/examples/playback/playback-test.c +++ b/tests/examples/playback/playback-test.c @@ -2422,8 +2422,8 @@ buffer_size_activate_cb (GtkEntry * entry, PlaybackApp * app) gchar *endptr; v = g_ascii_strtoll (text, &endptr, 10); - if (endptr != text && v != G_MAXINT64 && v != G_MININT64) { - g_object_set (app->pipeline, "buffer-size", v, NULL); + if (endptr != text && v >= G_MININT && v <= G_MAXINT) { + g_object_set (app->pipeline, "buffer-size", (gint) v, NULL); } } }