OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9b380a
)
cook: prevent div-by-zero if channels is zero.
author
Ronald S. Bultje
<rsbultje@gmail.com>
Fri, 17 Feb 2012 20:10:33 +0000
(12:10 -0800)
committer
Ronald S. Bultje
<rsbultje@gmail.com>
Fri, 17 Feb 2012 20:35:07 +0000
(12:35 -0800)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavcodec/cook.c
patch
|
blob
|
history
diff --git
a/libavcodec/cook.c
b/libavcodec/cook.c
index
8b6e116
..
bc262f1
100644
(file)
--- a/
libavcodec/cook.c
+++ b/
libavcodec/cook.c
@@
-1078,6
+1078,10
@@
static av_cold int cook_decode_init(AVCodecContext *avctx)
q->sample_rate = avctx->sample_rate;
q->nb_channels = avctx->channels;
q->bit_rate = avctx->bit_rate;
+ if (!q->nb_channels) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR_INVALIDDATA;
+ }
/* Initialize RNG. */
av_lfg_init(&q->random_state, 0);