Commit 58995f64 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

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>
parent 3a99f6e7
...@@ -900,6 +900,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) ...@@ -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"); 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