[FFmpeg-devel] [PATCH 3/4] libswresample: Avoid needlessly large on-stack array.

Michael Niedermayer michaelni at gmx.at
Wed Sep 3 06:28:17 CEST 2014


On Wed, Sep 03, 2014 at 12:01:54AM +0200, Reimar Döffinger wrote:
> We only actually use a tiny part of it.
> 
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libswresample/rematrix.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

i think there a multiple loops left that can access more of the array

2 i spotted:
 for(i=0; i<64; i++){
        if(in_ch_layout & out_ch_layout & (1ULL<<i))
            matrix[i][i]= 1.0;
    }

 if(s->rematrix_volume > 0){
        for(i=0; i<SWR_CH_MAX; i++)
            for(j=0; j<SWR_CH_MAX; j++){
                s->matrix[i][j] *= s->rematrix_volume;
            }
    }


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- 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/20140903/60a2d159/attachment.asc>


More information about the ffmpeg-devel mailing list