Bug 16524

Summary: oil_scaleconv_u32_f32 clips to s32
Product: liboil Reporter: Enrico Reimer <reimer>
Component: unknownAssignee: David Schleef <ds>
Status: NEW --- QA Contact: David Schleef <ds>
Severity: normal    
Priority: medium    
Version: HEAD   
Hardware: x86 (IA32)   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:

Description Enrico Reimer 2008-06-25 13:11:27 UTC
The following code should imho give 4294967294 (std::numeric_limits<uint32_t>::max()-1)

#include <iostream>
#include <liboil/liboil.h>
#include <limits>

int main (int argc, char * const argv[]) {
  float src=1;
  uint32_t dst;
  double s1=-1,s2=std::numeric_limits<uint32_t>::max();
  oil_init();
  oil_scaleconv_u32_f32(&dst,&src,1,&s1,&s2);
  std::cout << dst << std::endl;
  return 0;
}


But it prints 2147483647.
Seems like it clips to the maximum of int instead of uint.

I also could reproduce this error on debian etch/amd64 packaged liboil (0.3.10)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.