NetBSD-Bugs archive

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

bin/52762: audioplay cannot play with WAVE_FORMAT_EXTENSIBLE on BIG_ENDIAN arch



>Number:         52762
>Category:       bin
>Synopsis:       audioplay cannot play with WAVE_FORMAT_EXTENSIBLE on BIG_ENDIAN arch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 25 09:45:00 +0000 2017
>Originator:     Yosuke Sugahara
>Release:        NetBSD8
>Organization:
>Environment:
NetBSD 8.99.5 x68k
>Description:
audioplay can not play wav file with WAVE_FORMAT_EXTENSIBLE file on BIG_ENDIAN machine.

It is missing getle16() call reading subtag.
>How-To-Repeat:
% audioplay s32le.wav
audioplay: unsupported WAV format: s32le.wav
% audioplay -V s32le.wav
WAVE format tag: fffe
WAVE extensible sub tag: 1600
audioplay: unsupported WAV format: s32le.wav

>Fix:
RCS file: /cvsroot/src/usr.bin/audio/common/wav.c,v
retrieving revision 1.12
diff -u -r1.12 wav.c
--- wav.c       18 Oct 2013 20:47:06 -0000      1.12
+++ wav.c       25 Nov 2017 09:38:10 -0000
@@ -140,7 +140,7 @@
                memcpy(&ext, owhere + sizeof fmt, sizeof ext);
                if (getle16(ext.len) < sizeof(ext) - sizeof(ext.len))
                        return (AUDIO_ESHORTHDR);
-               fmttag = ext.sub_tag;
+               fmttag = getle16(ext.sub_tag);
                if (verbose)
                        printf("WAVE extensible sub tag: %x\n", fmttag);
        }



Home | Main Index | Thread Index | Old Index