projects
/
vuplus_xbmc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
991fb67
)
xbadpcm: fix crash on invalid input file
author
Anssi Hannula
<anssi@xbmc.org>
Sat, 31 Aug 2013 08:30:32 +0000
(11:30 +0300)
committer
Anssi Hannula
<anssi@xbmc.org>
Sat, 31 Aug 2013 08:33:21 +0000
(11:33 +0300)
If the sample rate or channel count is zero on a file opened with
ADPCMDll, a division by zero is performed causing XBMC to crash.
Fix that by adding the necessary check.
lib/xbadpcm/ADPCMDll.cpp
patch
|
blob
|
history
diff --git
a/lib/xbadpcm/ADPCMDll.cpp
b/lib/xbadpcm/ADPCMDll.cpp
index
67e27e5
..
b0dab89
100644
(file)
--- a/
lib/xbadpcm/ADPCMDll.cpp
+++ b/
lib/xbadpcm/ADPCMDll.cpp
@@
-47,6
+47,10
@@
extern "C"
int wavsize;
wavsize = mywav_data(info->f, &info->fmt);
+
+ if (info->fmt.dwSamplesPerSec == 0 || info->fmt.wChannels == 0)
+ return -1;
+
if(wavsize >= 0) {
if(info->fmt.wFormatTag != 0x0069) {
fseek(info->f,0,SEEK_SET);