[gimp/wip/animation: 117/197] plug-ins: animation_animatic_get_frame() can return NULL on empty cache.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/animation: 117/197] plug-ins: animation_animatic_get_frame() can return NULL on empty cache.
- Date: Sat, 7 Oct 2017 03:08:16 +0000 (UTC)
commit 1dbcbc9bc34c51065427e276ff2349886b507a7b
Author: Jehan <jehan girinstud io>
Date: Sun Jan 1 21:09:03 2017 +0100
plug-ins: animation_animatic_get_frame() can return NULL on empty cache.
We should only g_object_ref() if the cache has contents.
plug-ins/animation-play/core/animation-animatic.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/animation-play/core/animation-animatic.c
b/plug-ins/animation-play/core/animation-animatic.c
index 790549b..c91152b 100644
--- a/plug-ins/animation-play/core/animation-animatic.c
+++ b/plug-ins/animation-play/core/animation-animatic.c
@@ -388,12 +388,16 @@ animation_animatic_get_frame (Animation *animation,
gint pos)
{
AnimationAnimaticPrivate *priv;
+ GeglBuffer *frame = NULL;
gint panel;
priv = GET_PRIVATE (animation);
panel = animation_animatic_get_panel (ANIMATION_ANIMATIC (animation),
pos);
- return g_object_ref (priv->cache[panel]);
+ if (priv->cache[panel])
+ frame = g_object_ref (priv->cache[panel]);
+
+ return frame;
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]