Skip to content

Proper allocation/deallocation of BSpline HR filter model data

The IVAS object renderer (HR filter model) allocates memories for BSpline HR filter model data dynamically using malloc() in the file lib_util/hrtf_file_reader.c. Since this file is part of lib_util the WMC tool does not instrument it. However, the same memories are de-allocated in the file lib_rend/ivas_objectRenderer_hrFilt.c in the followwing functions:

LoadBSplineBinaryITD()
LoadBSplineBinary

Since these functions are part of lib_rend they are instrumented by the WMC tool. As a consequence, the WMC tool reports that a memory which has not been properly allocated is being de-allocated.

My suggestion would be to move these functions to lib_util.