[CLAM] There may be a bug in "audio.cxx"

Neediss Gu neediss at gmail.com
Wed Jul 19 01:25:05 PDT 2006


line 163:
//////////////////////////
if(endIndex>=GetSize())
 {
  TSize ending=endIndex-GetSize();
  memset(chunk.GetBuffer().GetPtr()+GetSize()-beginIndex
,0,ending*sizeof(TData));
  endIndex=GetSize();
 }

nBytesToCopy=(endIndex-beginIndex+1)*sizeof(double);
//////////////////////////
Maybe it should be changed to the following

if(endIndex>=GetSize())
 {
  TSize ending=endIndex-GetSize()+1;
  memset(chunk.GetBuffer().GetPtr()+GetSize()-beginIndex
+offset,0,ending*sizeof(TData));
  endIndex=GetSize();
 }

and  : size=endIndex-beginIndex; -> size=endIndex-beginIndex+1.

-- 
Gu Renmin (Charles Neediss)
Image, Graph, Video, Speech, Audio, ...
CS Dept. of Tongji University, Shanghai, China
Cell:   +(86) 13816064123
Work hard, work smart!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20060719/db24f3f6/attachment-0001.htm>


More information about the clam-users mailing list