[FFmpeg-devel] [PATCH 1/4] avcodec/dirac_dwt_template: Fix signedness regression in interleave()

Michael Niedermayer michael at niedermayer.cc
Sat Jul 14 02:16:07 EEST 2018


On Fri, Jul 13, 2018 at 07:59:43PM +0200, James Darnley wrote:
> On 2018-07-13 19:26, Michael Niedermayer wrote:
> > Found-by: <jdarnley>
> > 
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/dirac_dwt_template.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c
> > index 528fc7e9e7..2369c8d15b 100644
> > --- a/libavcodec/dirac_dwt_template.c
> > +++ b/libavcodec/dirac_dwt_template.c
> > @@ -57,8 +57,8 @@ static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src
> >  {
> >      int i;
> >      for (i = 0; i < w2; i++) {
> > -        dst[2*i  ] = (src0[i] + (unsigned)add) >> shift;
> > -        dst[2*i+1] = (src1[i] + (unsigned)add) >> shift;
> > +        dst[2*i  ] = ((int)(src0[i] + (unsigned)add)) >> shift;
> > +        dst[2*i+1] = ((int)(src1[i] + (unsigned)add)) >> shift;
> >      }
> >  }
> >  
> > 
> 
> This does fix the failure I saw.  

will apply


> I will submit a patch for more fate
> tests which happen to cover this piece of code.

thanks


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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180714/7e428e61/attachment.sig>


More information about the ffmpeg-devel mailing list