• Juan A. Suárez's avatar
    v3dv: check dest bitsize in color blit · 33f9b06b
    Juan A. Suárez authored
    Otherwise, if src_bit_size > 0 and dst_bit_size == 0, we end up doing a
    bad shift in `1 << (dst_bit_size - 1)`, as `dst_bit_size - 1` is a
    negative value (in this case would be MAX_UINT32).
    Fixes CID#1468134 "Bad bit shift operation (BAD_SHIFT)":
       "large_shift: In expression 1 << dst_bit_size - 1U, left shifting by
        more than 31 bits has undefined behavior. The shift amount,
        dst_bit_size - 1U, is 4294967295."
     - Use an assertion instead (Iago)
    Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
    Signed-off-by: Juan A. Suárez's avatarJuan A. Suarez Romero <jasuarez@igalia.com>
    Part-of: <!10251>
v3dv_meta_copy.c 205 KB