aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-09 22:41:24 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-09 23:21:51 +0200
commit58995f647b5fa2e1efa33ae4f8b8a76a81ec99df (patch)
tree35456b4372ca352b9bd0d2786afa3609bc1654c4 /libavcodec
parent3a99f6e79fa3ac4d280f52fddbc234a56d78a488 (diff)
downloadffmpeg-58995f647b5fa2e1efa33ae4f8b8a76a81ec99df.tar.gz
sonic: set avctx->channels in sonic_decode_init
Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/sonic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 3db77f30a3..c5076f9d8e 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -900,6 +900,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n");
return AVERROR_INVALIDDATA;
}
+ avctx->channels = s->channels;
s->lossless = get_bits1(&gb);
if (!s->lossless)