projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4391805
)
adpcm: Check for channels to be a non-zero integer
author
Shitiz Garg
<mail@dragooon.net>
Sat, 17 Dec 2011 14:05:59 +0000
(19:35 +0530)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Sat, 17 Dec 2011 14:44:19 +0000
(09:44 -0500)
channels would be 0 sometimes and would cause floating point exception
Fixes bugzilla #124
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
libavcodec/adpcm.c
patch
|
blob
|
history
diff --git
a/libavcodec/adpcm.c
b/libavcodec/adpcm.c
index
3ada328
..
48f44fe
100644
(file)
--- a/
libavcodec/adpcm.c
+++ b/
libavcodec/adpcm.c
@@
-101,8
+101,9
@@
static av_cold int adpcm_decode_init(AVCodecContext * avctx)
max_channels = 6;
break;
}
- if(avctx->channels > max_channels){
- return -1;
+ if (avctx->channels <= 0 || avctx->channels > max_channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR(EINVAL);
}
switch(avctx->codec->id) {