From 76a8e5cd2a64d21d4df09ec64ea8832c6f471977 Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 23 Apr 2014 14:43:54 -0700 Subject: [PATCH] cmProc.c : Fix bug where endFrmIdx==cmInvalidIdx is not properly handled in cmAudioFileRdOpen() --- cmProc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmProc.c b/cmProc.c index 5a2df5e..da04f5d 100644 --- a/cmProc.c +++ b/cmProc.c @@ -116,7 +116,7 @@ cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt, return cmCtxRtCondition( &p->obj, afRC, "Unable to open the audio file:'%s'", fn ); p->chIdx = chIdx; - p->outN = procSmpCnt; + p->outN = endFrmIdx==cmInvalidIdx ? p->info.frameCnt : procSmpCnt; p->outV = cmMemResizeZ( cmSample_t, p->outV, p->outN ); p->fn = cmMemResizeZ( cmChar_t, p->fn, strlen(fn)+1 ); strcpy(p->fn,fn);