[banshee] libbanshee: Fix crash on g_free when look for subtile description
- From: Olivier Dufour <dufoli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] libbanshee: Fix crash on g_free when look for subtile description
- Date: Thu, 1 Sep 2011 19:51:20 +0000 (UTC)
commit 0716aa69a57a008870bd1e4da8d1713a850852b7
Author: Olivier Dufour <olivier duff gmail com>
Date: Thu Sep 1 21:45:36 2011 +0200
libbanshee: Fix crash on g_free when look for subtile description
This crash appear on gstreamer version before 0.10.24 because code are
not always setup and it was not initialise to null so it can
contain random memory which lead to crash.
A small mem leak was fixed too in same function.
libbanshee/banshee-player.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libbanshee/banshee-player.c b/libbanshee/banshee-player.c
index 8d8eacc..0ce8ed1 100644
--- a/libbanshee/banshee-player.c
+++ b/libbanshee/banshee-player.c
@@ -476,7 +476,7 @@ bp_get_subtitle_uri (BansheePlayer *player)
P_INVOKE gchar *
bp_get_subtitle_description (BansheePlayer *player, int i)
{
- gchar *code;
+ gchar *code = NULL;
gchar *desc = NULL;
GstTagList *tags = NULL;
@@ -491,6 +491,7 @@ bp_get_subtitle_description (BansheePlayer *player, int i)
// ISO 639-2 undetermined language
if (strcmp ((const gchar *)code, "und") == 0) {
+ g_free (code);
return NULL;
}
bp_debug ("[subtitle]: iso 639-2 subtitle code %s", code);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]