Opened 9 years ago

Closed 9 years ago

#19 closed defect (fixed)

new_aubio_pitch returns NULL for unknown pitch detection methods

Reported by: Olivier Robert Owned by: Paul Brossier
Priority: normal Milestone: 0.3.3
Component: corelib Version: 0.3.2
Severity: critical Keywords:


In pitch.c, in the function new_aubio_pitch() the first part of the code identifies the pitch_type. If the pitch_type cannot be identified, I think there are two possible strategies : 1/ free the allocated memory and return NULL 2/ use a default pitch type and continue

Here the the implementation does something different : use a default pitch and return NULL

AUBIO_ERR ("unknown pitch detection method %s, using default.\n", pitch_mode); pitch_type = aubio_pitcht_default; return NULL;

Obviously I think it is not intended, since it creates a memory leak.

What about the 2nd strategy ? (Remove the "return NULL" statement.)

Change History (3)

comment:1 Changed 9 years ago by anonymous

This the part of code I'm talking about :

comment:2 Changed 9 years ago by Paul Brossier

Status: newassigned

Hello Olivier,

Thanks for your report. Removing the return NULL; (2) seems to make much more sense indeed! I will test and commit as soon as possible.

Best, Paul

comment:3 Changed 9 years ago by Paul Brossier

Resolution: fixed
Status: assignedclosed

this was closed in b583b9fb673169

Note: See TracTickets for help on using tickets.