Bug 16524 - oil_scaleconv_u32_f32 clips to s32
Summary: oil_scaleconv_u32_f32 clips to s32
Status: NEW
Alias: None
Product: liboil
Classification: Unclassified
Component: unknown (show other bugs)
Version: HEAD
Hardware: x86 (IA32) Mac OS X (All)
: medium normal
Assignee: David Schleef
QA Contact: David Schleef
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-25 13:11 UTC by Enrico Reimer
Modified: 2008-06-25 13:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.