[FFmpeg-devel] [PATCH] sonic: use s->channels instead of avctx->channels

Michael Niedermayer michaelni at gmx.at
Tue Jun 9 23:04:31 CEST 2015


On Tue, Jun 09, 2015 at 10:44:08PM +0200, Andreas Cadhalpun wrote:
> On 09.06.2015 22:30, Michael Niedermayer wrote:
> > On Tue, Jun 09, 2015 at 10:22:05PM +0200, Andreas Cadhalpun wrote:
> >> avctx->channels can be 0, causing SIGFPE crashes.
> >>
> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> >> ---
> >>  libavcodec/sonic.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > i think avctx->channels should be set, channels is only set during
> > init and cannot change per frame in sonic
> > maybe avctx->channels could be set during init
> 
> Yes, that's way better, because it actually allows decoding such samples.
> New patch attached.
> 
> Best regards,
> Andreas
> 

>  sonic.c |    1 +
>  1 file changed, 1 insertion(+)
> 3eb2f8fa1f33a5d4ab0434d45a1d584b1774fa3a  0001-sonic-set-avctx-channels-in-sonic_decode_init.patch
> From 489bc2758317c5534ae1292c3f772e0dc870d0e4 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Tue, 9 Jun 2015 22:41:24 +0200
> Subject: [PATCH] sonic: set avctx->channels in sonic_decode_init
> 
> Otherwise it can be 0 in sonic_decode_frame causing SIGFPE crashes.

LGTM

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150609/f58f7785/attachment.asc>


More information about the ffmpeg-devel mailing list