[xiph-commits] r19084 - trunk/squishyball
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Mon Feb 10 20:59:52 PST 2014
Author: xiphmont
Date: 2014-02-10 20:59:52 -0800 (Mon, 10 Feb 2014)
New Revision: 19084
Modified:
trunk/squishyball/loader.c
Log:
Fix segfault when loading 24-bit WAV files. Patch submitted by Andrew Ekstedt.
Modified: trunk/squishyball/loader.c
===================================================================
--- trunk/squishyball/loader.c 2014-02-07 17:43:01 UTC (rev 19083)
+++ trunk/squishyball/loader.c 2014-02-11 04:59:52 UTC (rev 19084)
@@ -2,7 +2,7 @@
*
* squishyball
*
- * Copyright (C) 2010-2013 Xiph.Org
+ * Copyright (C) 2010-2014 Xiph.Org
*
* squishyball is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -376,7 +376,7 @@
pcm->size=pcm->size/2*sizeof(float);
break;
case 24:
- k=pcm->size*4/3;
+ k=pcm->size/3;
for(j=pcm->size-3;j>=0;j-=3)
f[--k] = (int32_t)((d[j]<<8)|(d[j+1]<<16)|(d[j+2]<<24)) * (1.f/2147483648.f);
pcm->size=pcm->size/3*sizeof(float);
More information about the commits
mailing list