shithub: aubio

Download patch

ref: e2eee03c8da88cad343f6c801f05da245c711e6c
parent: a315be7e0d0b5c2ba0bd7f7a2cb3b1cb15defda4
author: Paul Brossier <piem@piem.org>
date: Tue Mar 11 08:04:52 EDT 2014

src/spectral/phasevoc.c: avoid unsigned < 0 comparison

--- a/src/spectral/phasevoc.c
+++ b/src/spectral/phasevoc.c
@@ -111,7 +111,8 @@
   /* less than 50% overlap, reset latest grain trail */
   else pv->start = win_s - hop_s - hop_s;
 
-  pv->end = MAX(0, win_s - hop_s);
+  if (win_s > hop_s) pv->end = win_s - hop_s;
+  else pv->end = 0;
 
   pv->end_datasize = pv->end * sizeof(smpl_t);
   pv->hop_datasize = pv->hop_s * sizeof(smpl_t);