[clutter-gst/clutter-gst-3.0] player: fix segfault when sink emits a NULL frame
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst/clutter-gst-3.0] player: fix segfault when sink emits a NULL frame
- Date: Fri, 4 Nov 2016 00:58:46 +0000 (UTC)
commit b4ff502a31bc09dea60f1d02ae2a19eb45924039
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Fri Nov 4 00:54:12 2016 +0000
player: fix segfault when sink emits a NULL frame
https://bugzilla.gnome.org/show_bug.cgi?id=773810
clutter-gst/clutter-gst-player.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-player.c b/clutter-gst/clutter-gst-player.c
index 6dc9823..c106ac5 100644
--- a/clutter-gst/clutter-gst-player.c
+++ b/clutter-gst/clutter-gst-player.c
@@ -43,6 +43,8 @@
#include "config.h"
#endif
+#include <string.h>
+
#include "clutter-gst-enum-types.h"
#include "clutter-gst-marshal.h"
#include "clutter-gst-player.h"
@@ -388,19 +390,18 @@ clutter_gst_player_update_frame (ClutterGstPlayer *player,
ClutterGstFrame *new_frame)
{
ClutterGstFrame *old_frame = *frame;
+ ClutterGstVideoResolution old_res = { 0, }, new_res = { 0, };
*frame = g_boxed_copy (CLUTTER_GST_TYPE_FRAME, new_frame);
- if (old_frame == NULL ||
- new_frame->resolution.width != old_frame->resolution.width ||
- new_frame->resolution.height != old_frame->resolution.height ||
- new_frame->resolution.par_n != old_frame->resolution.par_n ||
- new_frame->resolution.par_d != old_frame->resolution.par_d)
- {
- g_signal_emit (player, signals[SIZE_CHANGE], 0,
- new_frame->resolution.width,
- new_frame->resolution.height);
- }
+ if (old_frame)
+ old_res = old_frame->resolution;
+ if (new_frame)
+ new_res = new_frame->resolution;
+
+ if (memcmp(&old_res, &new_res, sizeof(old_res)) != 0)
+ g_signal_emit (player, signals[SIZE_CHANGE], 0,
+ new_res.width, new_res.height);
if (old_frame)
g_boxed_free (CLUTTER_GST_TYPE_FRAME, old_frame);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]