On Mon, Jul 03, 2017 at 08:18:32PM +0200, Luca Barbato wrote:
> On 6/28/17 12:27 AM, Diego Biurrun wrote:
> > --- a/libavcodec/cinepakenc.c
> > +++ b/libavcodec/cinepakenc.c
> > @@ -212,10 +211,10 @@ static av_cold int cinepak_encode_init(AVCodecContext 
> > *avctx)
> >          if (!(s->input_frame = av_frame_alloc()))
> >              goto enomem;
> >  
> > -    if (!(s->codebook_input = av_malloc(sizeof(int) * (avctx->pix_fmt == 
> > AV_PIX_FMT_RGB24 ? 6 : 4) * (avctx->width * avctx->height) >> 2)))
> > +    if (!(s->codebook_input = av_malloc(sizeof(*s->codebook_input) * 
> > (avctx->pix_fmt == AV_PIX_FMT_RGB24 ? 6 : 4) * (avctx->width * 
> > avctx->height) >> 2)))
> >          goto enomem;
> >  
> 
> av_malloc_array
> 
> > -    if (!(s->codebook_closest = av_malloc(sizeof(int) * (avctx->width * 
> > avctx->height) >> 2)))
> > +    if (!(s->codebook_closest = av_malloc(sizeof(*s->codebook_closest) * 
> > (avctx->width * avctx->height) >> 2)))
> 
> av_malloc_array

That won't play nice with the shift, which is done after the multiplication.
Whether or not that is intentional, I don't know.

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to