[gegl] gegl: avoid allocating data for empty GeglAudioFragments
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: avoid allocating data for empty GeglAudioFragments
- Date: Fri, 12 May 2017 00:23:49 +0000 (UTC)
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]