Commit f87d76e6 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

sonic: set avctx->channels in sonic_decode_init

Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes.
Reviewed-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 58995f64)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fabb394a
...@@ -884,6 +884,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) ...@@ -884,6 +884,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"); av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
avctx->channels = s->channels;
s->lossless = get_bits1(&gb); s->lossless = get_bits1(&gb);
if (!s->lossless) if (!s->lossless)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment