NetBSD Problem Report #52762

From www@NetBSD.org  Sat Nov 25 09:41:05 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4AB117A16A
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 25 Nov 2017 09:41:05 +0000 (UTC)
Message-Id: <20171125094104.887317A1EE@mollari.NetBSD.org>
Date: Sat, 25 Nov 2017 09:41:04 +0000 (UTC)
From: dev@sss.rxz.jp
Reply-To: dev@sss.rxz.jp
To: gnats-bugs@NetBSD.org
Subject: audioplay cannot play with WAVE_FORMAT_EXTENSIBLE on BIG_ENDIAN arch
X-Send-Pr-Version: www-1.0

>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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 25 09:45:00 +0000 2017
>Closed-Date:    Mon Nov 27 14:47:14 +0000 2017
>Last-Modified:  Mon Nov 27 14:47:14 +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);
        }

>Release-Note:

>Audit-Trail:
From: "Jaromir Dolecek" <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52762 CVS commit: src/usr.bin/audio/common
Date: Sat, 25 Nov 2017 17:18:15 +0000

 Module Name:	src
 Committed By:	jdolecek
 Date:		Sat Nov 25 17:18:15 UTC 2017

 Modified Files:
 	src/usr.bin/audio/common: wav.c

 Log Message:
 need getle16() for ext.sub_tag too

 PR bin/52762 by Yosuke Sugahara


 To generate a diff of this commit:
 cvs rdiff -u -r1.13 -r1.14 src/usr.bin/audio/common/wav.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Sat, 25 Nov 2017 17:20:29 +0000
State-Changed-Why:
Patch applied, thank you.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52762 CVS commit: [netbsd-8] src/usr.bin/audio/common
Date: Mon, 27 Nov 2017 12:00:37 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Nov 27 12:00:37 UTC 2017

 Modified Files:
 	src/usr.bin/audio/common [netbsd-8]: wav.c

 Log Message:
 Pull up following revision(s) (requested by jdolecek in ticket #395):
 	usr.bin/audio/common/wav.c: revision 1.14
 need getle16() for ext.sub_tag too
 PR bin/52762 by Yosuke Sugahara


 To generate a diff of this commit:
 cvs rdiff -u -r1.13 -r1.13.8.1 src/usr.bin/audio/common/wav.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Mon, 27 Nov 2017 14:47:14 +0000
State-Changed-Why:
Change pulled up to netbsd-8 too now. Thanks for report and patch!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.