Commit 3ea5539f authored by sagnowski's avatar sagnowski
Browse files

Add tmp fix for OOB write problems

parent 27b7de2f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -170,7 +170,8 @@

#define FLOAT_INTERFACE_DEC_REND
#ifdef FLOAT_INTERFACE_DEC_REND
#define FLOAT_INTERFACE_DEC_REND_DBG_OOB_WRITES
#define FLOAT_INTERFACE_DEC_REND_TMP_OOB_FIX
// #define FLOAT_INTERFACE_DEC_REND_DBG_OOB_WRITES
#endif

/* ################## End DEVELOPMENT switches ######################### */
+24 −13
Original line number Diff line number Diff line
@@ -123,7 +123,11 @@ ivas_error ivas_dec(
     * Currently this is solved by allocating `outputMemory` as the underlying buffer of `output` and
     * copying from `outputMemory` to `data` at the end of this function.
     */
#ifdef FLOAT_INTERFACE_DEC_REND_TMP_OOB_FIX
    save_channel_pointers( outputMemory, MAX_OUTPUT_CHANNELS, L_FRAME48k, output );
#else
    save_channel_pointers( outputMemory, MAX_OUTPUT_CHANNELS, output_frame, output );
#endif

#ifdef FLOAT_INTERFACE_DEC_REND_DBG_OOB_WRITES
    /* Overwrite channel pointers with a newly allocated buffer for each channel,
@@ -641,7 +645,14 @@ ivas_error ivas_dec(
    }
#endif

    mvr2r( outputMemory, data, output_frame * nchan_out );
#ifdef FLOAT_INTERFACE_DEC_REND_TMP_OOB_FIX
    for ( n = 0; n < nchan_out; ++n )
    {
        mvr2r( output[n], data + n * output_frame, output_frame );
    }
#else
    mvr2r( outputMemory, data, output_frame * nchan_out ); /* TODO(sgi): Only needed until the hacky outputMemory is in use */
#endif
#else
    /* float to integer conversion moved to IVAS_DEC_GetSamples() */
#ifdef DEBUGGING