[longomatch] editor: fix segfault with long titles



commit 3406d31218faf9fc94bca8de762cf3106c7cfe61
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sun Dec 29 20:48:43 2013 +0100

    editor: fix segfault with long titles

 libcesarplayer/gst-nle-source.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libcesarplayer/gst-nle-source.c b/libcesarplayer/gst-nle-source.c
index 5368a5e..9ee1984 100644
--- a/libcesarplayer/gst-nle-source.c
+++ b/libcesarplayer/gst-nle-source.c
@@ -261,8 +261,9 @@ gst_nle_source_update_overlay_title (GstNleSource * nlesrc)
   g_object_set (G_OBJECT (nlesrc->textoverlay), "text", item->title, NULL);
 
   length = g_utf8_strlen (item->title, -1);
-  if (length * nlesrc->title_size > nlesrc->width) {
-    gst_nle_source_apply_title_size (nlesrc, nlesrc->width / length - 1);
+  length *= 2;
+  if (length * nlesrc->title_size > nlesrc->height) {
+    gst_nle_source_apply_title_size (nlesrc, nlesrc->height / length - 1);
   } else {
     gst_nle_source_apply_title_size (nlesrc, nlesrc->title_size);
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]