diff mbox

[FFmpeg-devel,3/4] avcodec/sbcdec: Initilaize nubmer of channels

Message ID 20190925100120.12305-3-michael@niedermayer.cc
State Accepted
Commit 02fb6a214717d40487cae2b06f13b14fabb6e101
Headers show

Commit Message

Michael Niedermayer Sept. 25, 2019, 10:01 a.m. UTC
Fixes: out of array access
Fixes: 17609/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5758729319874560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/sbcdec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paul B Mahol Sept. 26, 2019, 11:47 a.m. UTC | #1
lgtm

On 9/25/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: out of array access
> Fixes:
> 17609/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5758729319874560
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/sbcdec.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
> index 546b38c106..937946e2d2 100644
> --- a/libavcodec/sbcdec.c
> +++ b/libavcodec/sbcdec.c
> @@ -348,6 +348,7 @@ static int sbc_decode_frame(AVCodecContext *avctx,
>      if (frame_length <= 0)
>          return frame_length;
>
> +    avctx->channels =
>      frame->channels = sbc->frame.channels;
>      frame->format = AV_SAMPLE_FMT_S16P;
>      frame->nb_samples = sbc->frame.blocks * sbc->frame.subbands;
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Paul B Mahol Sept. 26, 2019, 11:48 a.m. UTC | #2
please fix typo in commit message, nubmer

On 9/26/19, Paul B Mahol <onemda@gmail.com> wrote:
> lgtm
>
> On 9/25/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
>> Fixes: out of array access
>> Fixes:
>> 17609/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5758729319874560
>>
>> Found-by: continuous fuzzing process
>> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>> ---
>>  libavcodec/sbcdec.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
>> index 546b38c106..937946e2d2 100644
>> --- a/libavcodec/sbcdec.c
>> +++ b/libavcodec/sbcdec.c
>> @@ -348,6 +348,7 @@ static int sbc_decode_frame(AVCodecContext *avctx,
>>      if (frame_length <= 0)
>>          return frame_length;
>>
>> +    avctx->channels =
>>      frame->channels = sbc->frame.channels;
>>      frame->format = AV_SAMPLE_FMT_S16P;
>>      frame->nb_samples = sbc->frame.blocks * sbc->frame.subbands;
>> --
>> 2.23.0
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Moritz Barsnick Sept. 26, 2019, 1:08 p.m. UTC | #3
> please fix typo in commit message, nubmer

and "Initilaize" -> "Initialize".
Michael Niedermayer Sept. 26, 2019, 6:30 p.m. UTC | #4
On Thu, Sep 26, 2019 at 03:08:59PM +0200, Moritz Barsnick wrote:
> > please fix typo in commit message, nubmer

will do

> 
> and "Initilaize" -> "Initialize".

will do too

thanks

[...]
diff mbox

Patch

diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index 546b38c106..937946e2d2 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -348,6 +348,7 @@  static int sbc_decode_frame(AVCodecContext *avctx,
     if (frame_length <= 0)
         return frame_length;
 
+    avctx->channels =
     frame->channels = sbc->frame.channels;
     frame->format = AV_SAMPLE_FMT_S16P;
     frame->nb_samples = sbc->frame.blocks * sbc->frame.subbands;