Browse Source

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>
tags/n2.7
Andreas Cadhalpun 10 years ago
parent
commit
58995f647b
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/sonic.c

+ 1
- 0
libavcodec/sonic.c View File

@@ -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)


Loading…
Cancel
Save