[PATCH][weston] vaapi-recorder: Fix allocator sizeof operand mismatch

Bryce Harrington bryce at osg.samsung.com
Tue Sep 22 17:29:42 PDT 2015


On Tue, Sep 22, 2015 at 05:21:58PM -0700, Bryce Harrington wrote:
> On Sun, Sep 20, 2015 at 11:12:50AM -0300, Lucas Tanure wrote:
> > Result of 'calloc' is converted to a pointer of type 'unsigned int', which is
> > incompatible with sizeof operand type 'int'
> 
> In practice uint and int will result in the same size, but this is more
> technically correct, so yep good find.
> 
> struct bitstream {
>         unsigned int *buffer;
> 	...
> 
> > Signed-off-by: Lucas Tanure <tanure at linux.com>
> 
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

Thanks, pushed:

remote: I: patch #59960 updated using rev bfae30d814d75b1ca0c75e325977a3d55b62266b
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/wayland/weston
   193c7a5..bfae30d  master -> master

 
> > ---
> >  src/vaapi-recorder.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/vaapi-recorder.c b/src/vaapi-recorder.c
> > index c93f7b9..1fd7ebe 100644
> > --- a/src/vaapi-recorder.c
> > +++ b/src/vaapi-recorder.c
> > @@ -141,7 +141,7 @@ static void
> >  bitstream_start(struct bitstream *bs)
> >  {
> >  	bs->max_size_in_dword = BITSTREAM_ALLOCATE_STEPPING;
> > -	bs->buffer = calloc(bs->max_size_in_dword * sizeof(int), 1);
> > +	bs->buffer = calloc(bs->max_size_in_dword * sizeof(unsigned int), 1);
> >  	bs->bit_offset = 0;
> >  }
> >  
> > -- 
> > 2.5.3
> > 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list