<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>695</bug_id>
          
          <creation_ts>2013-02-28 19:50:29 +0100</creation_ts>
          <short_desc>Buffer underflow in WindowsWGLGraphicsConfiguration</short_desc>
          <delta_ts>2013-02-28 20:43:55 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>windows</component>
          <version>2</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>rjbogue</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl 7f2637bfe5ef1764882a123a8942e60632730bdf</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2231</commentid>
    <comment_count>0</comment_count>
    <who name="">rjbogue</who>
    <bug_when>2013-02-28 19:50:29 +0100</bug_when>
    <thetext>I encountered a case on an NVidia Quadro 3500 fx where the call to WGLExt.wglChoosePixelFormatARB in WindowsWGLGraphicsConfiguration (currently line 355) returns 264 in numFormatsTmp despite 256 being passed in for the maximum number of formats. This results in a buffer underflow on line 368 since pformatsTmp only has 256 values and it&apos;s trying to copy 264 values.

I recommend the following change to account for this bug in the driver:

&lt; final int numFormats = numFormatsTmp.get(0);
---
&gt; final int numFormats = Math.min(numFormatsTmp.get(0), WindowsWGLGraphicsConfiguration.MAX_PFORMATS);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2232</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-02-28 20:43:55 +0100</bug_when>
    <thetext>http://jogamp.org/git/?p=jogl.git;a=commit;h=7f2637bfe5ef1764882a123a8942e60632730bdf

Thank you!

~Sven</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>