[gegl] gegl: avoid allocating data for empty GeglAudioFragments



commit c1a41927ea2ea308fd6d3b6aa1551acec883770b
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri May 12 02:23:27 2017 +0200

    gegl: avoid allocating data for empty GeglAudioFragments

 gegl/property-types/gegl-audio-fragment.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gegl/property-types/gegl-audio-fragment.c b/gegl/property-types/gegl-audio-fragment.c
index ae027e5..a857041 100644
--- a/gegl/property-types/gegl-audio-fragment.c
+++ b/gegl/property-types/gegl-audio-fragment.c
@@ -67,7 +67,8 @@ static void allocate_data (GeglAudioFragment *audio)
 {
   int i;
   deallocate_data (audio);
-  if (audio->priv->channels * audio->priv->max_samples == 0)
+  if (audio->priv->channels <= 0 ||
+      audio->priv->max_samples <= 0)
     return;
   for (i = 0; i < audio->priv->channels; i++)
   {


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