[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wavread problem with Octave 3.2.3

From: Jordi Gutiérrez Hermoso
Subject: Re: wavread problem with Octave 3.2.3
Date: Wed, 11 Aug 2010 15:37:31 -0500

On 2 August 2010 09:46, tdtodd <address@hidden> wrote:
> I'm having a problem reading a wav file and getting "error: memory exhausted
> or requested size too large for range of Octave's index type -- trying to
> return to prompt".

On 7 August 2010 10:41, tdtodd <address@hidden> wrote:
> Thanks ... I've posted the file in my public Dropbox at

I made a few weak attempts to diagnose this. Unfortunately, I don't
really understand how a RIFF and Microsoft PCM works, but a bit of
printf debugging quickly pointed out that the problem is that for
whatever reason, data_size in line 100 of wavread.m is a ridiculously
large number. The function that produces it is find_chunk in the same
file. Octave later tries to allocate a vector of this order of
magnitude, which is where you see the failure.

Interestingly enough, I was unable to reproduce the exact same problem
on the development sources. I think that bug #30309 that Rik patched
with changeset 10738:a4b8364e04c7 may have also squashed or alleviated
the one you're seeing. I still see Octave consuming a ridiculous
amount of memory even with this patch.

Can you try patching your version? There are several cosmetic changes
in that changeset. The only hunk of that patch that seems relevant is

@@ -230,6 +231,8 @@
     fseek (fid, chunk_size, "cof");
     id = char (fread (fid, 4))';
     chunk_size = fread (fid, 1, "uint32", 0, "ieee-le");
+    ## Chunk sizes must be word-aligned (2 byte)
+    chunk_size += rem (chunk_size, 2);
     offset = offset + 8 + chunk_size;
   if (! strcmp (id, chunk_id))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]