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

Bryce Harrington bryce at osg.samsung.com
Tue Sep 22 17:21:58 PDT 2015


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>

> ---
>  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


More information about the wayland-devel mailing list