bugGNU Octave - Bugs: bug #30309, Function wavread() fails for wave...


bug #30309: Function wavread() fails for wave files with odd-sized RIFF chunks.

Submitted by:  Fardan Iqbal <fiqbal>
Submitted on:  Thu 01 Jul 2010 02:28:07 AM UTC  
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Fardan Iqbal Open/Closed:  Closed
Release:  3.2.3 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 02 Jul 2010 09:31:06 PM UTC, comment #1: 
Rik <rik5>
Project Administrator
Thu 01 Jul 2010 02:28:07 AM UTC, original submission:  

The `wavread()' function (defined in wavread.m) fails with an error message saying "file contains no data chunk".  This happens when you try to read a wave file that has an odd-sized RIFF chunk before the main data chunk.

After looking at wavread.m, it looks like the cause of this problem is that the `find_chunk()' function (used by `wavread()') does not account for the padding byte that well-formed wave files must have at the end of odd-sized chunks.

A possible fix is to round the `chunk_size' variable up to an even number before adding it to `offset' in the `find_chunk()' function.

Attached to this report is a wave file that demonstrates the problem.  This file contains a 79-byte list chunk with a padding byte at the end.  Typing the following command:

    Y = wavread("oddchunk.wav")

will cause the error.

This bug was discovered on Fedora Core 12 running on x86_64.  Octave was configured for "x86_64-redhat-linux-gnu".

Fardan Iqbal <fiqbal>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #20862:  oddchunk.wav added by fiqbal (454KiB - audio/x-wav)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by fiqbal (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-02 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed
    2010-07-01 fiqbal Attached File- => Added oddchunk.wav, #20862

    Back to the top

    Powered by Savane 3.5