VirtualBox

Ignore:
Timestamp:
Jul 18, 2018 8:07:50 PM (6 years ago)
Author:
vboxsync
Message:

3D: texture unpacking reworked, bugref:9192. Merged r123597, r123598, r123600, r123601, r123755.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0:104445,104938,104943,104950,104952-104953,104987-104988,104990,106453
        99/branches/VBox-5.1:112367,115992,116543,116550,116568,116573
        10 /branches/VBox-5.2:120083,120099,120213,120221,120239
         10/branches/VBox-5.2:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755
        1111/branches/andy/draganddrop:90781-91268
        1212/branches/andy/guestctrl20:78916,78930
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453
        99/branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573
        10 /branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239
         10/branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755
        1111/branches/andy/draganddrop/src/VBox:90781-91268
        1212/branches/andy/guestctrl20/src/VBox:78916,78930
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_drawpixels.c

    r69390 r73223  
    88#include "cr_error.h"
    99
     10#include "state/cr_bufferobject.h"
     11
    1012void crUnpackDrawPixels( void )
    1113{
     
    1618    GLint noimagedata = READ_DATA( sizeof( int ) + 16, GLint );
    1719    GLvoid *pixels;
     20
     21    if (noimagedata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     22        return;
    1823
    1924    if (noimagedata)
     
    4247    GLuint noimagedata = READ_DATA( sizeof( int ) + 24, GLuint );
    4348    GLubyte *bitmap;
     49
     50    if (noimagedata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     51        return;
    4452
    4553    if (noimagedata)
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_pixelmap.c

    r69390 r73223  
    66
    77#include "unpacker.h"
     8#include "state/cr_bufferobject.h"
    89
    910void crUnpackPixelMapfv( void  )
     
    1314    int nodata = READ_DATA( sizeof(int) + 8, int);
    1415    GLfloat *values;
     16
     17    if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     18        return;
    1519
    1620    if (nodata)
     
    3034    GLuint *values;
    3135
     36    if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     37        return;
     38
    3239    if (nodata)
    3340        values = (GLuint*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
     
    4653    GLushort *values;
    4754
     55    if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     56        return;
     57
    4858    if (nodata)
    4959        values = (GLushort*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_program.c

    r71903 r73223  
    9292void crUnpackExtendAreProgramsResidentNV(void)
    9393{
    94         GLsizei n = READ_DATA(8, GLsizei);
    95         const GLuint *programs = DATA_POINTER(12, const GLuint);
    96         SET_RETURN_PTR(12 + n * sizeof(GLuint));
    97         SET_WRITEBACK_PTR(20 + n * sizeof(GLuint));
    98         (void) cr_unpackDispatch.AreProgramsResidentNV(n, programs, NULL);
     94    GLsizei n = READ_DATA(8, GLsizei);
     95    const GLuint *programs = DATA_POINTER(12, const GLuint);
     96
     97    if (n > UINT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK(20 + n * sizeof(GLuint)))
     98    {
     99        crError("crUnpackExtendAreProgramsResidentNV: %d is out of range", n);
     100        return;
     101    }
     102
     103    SET_RETURN_PTR(12 + n * sizeof(GLuint));
     104    SET_WRITEBACK_PTR(20 + n * sizeof(GLuint));
     105    (void) cr_unpackDispatch.AreProgramsResidentNV(n, programs, NULL);
    99106}
    100107
     
    215222void crUnpackExtendGetProgramNamedParameterdvNV(void)
    216223{
    217         GLuint id = READ_DATA(8, GLuint);
    218         GLsizei len = READ_DATA(12, GLsizei);
    219         const GLubyte *name = DATA_POINTER(16, GLubyte);
    220         SET_RETURN_PTR(16+len);
    221         SET_WRITEBACK_PTR(16+len+8);
    222         cr_unpackDispatch.GetProgramNamedParameterdvNV(id, len, name, NULL);
     224    GLuint id = READ_DATA(8, GLuint);
     225    GLsizei len = READ_DATA(12, GLsizei);
     226    const GLubyte *name = DATA_POINTER(16, GLubyte);
     227
     228    if (len > UINT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
     229    {
     230        crError("crUnpackExtendGetProgramNamedParameterdvNV: len %d is out of range", len);
     231        return;
     232    }
     233
     234    SET_RETURN_PTR(16+len);
     235    SET_WRITEBACK_PTR(16+len+8);
     236    cr_unpackDispatch.GetProgramNamedParameterdvNV(id, len, name, NULL);
    223237}
    224238
    225239void crUnpackExtendGetProgramNamedParameterfvNV(void)
    226240{
    227         GLuint id = READ_DATA(8, GLuint);
    228         GLsizei len = READ_DATA(12, GLsizei);
    229         const GLubyte *name = DATA_POINTER(16, GLubyte);
    230         SET_RETURN_PTR(16+len);
    231         SET_WRITEBACK_PTR(16+len+8);
    232         cr_unpackDispatch.GetProgramNamedParameterfvNV(id, len, name, NULL);
     241    GLuint id = READ_DATA(8, GLuint);
     242    GLsizei len = READ_DATA(12, GLsizei);
     243    const GLubyte *name = DATA_POINTER(16, GLubyte);
     244
     245    if (len > UINT32_MAX / 4 || !DATA_POINTER_CHECK(16 + len + 8))
     246    {
     247        crError("crUnpackExtendGetProgramNamedParameterfvNV: len %d is out of range", len);
     248        return;
     249    }
     250
     251    SET_RETURN_PTR(16+len);
     252    SET_WRITEBACK_PTR(16+len+8);
     253    cr_unpackDispatch.GetProgramNamedParameterfvNV(id, len, name, NULL);
    233254}
    234255
  • trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_texture.c

    r70601 r73223  
    327327    GLsizei n = READ_DATA( 8, GLsizei );
    328328    const GLuint *textures = DATA_POINTER( 12, const GLuint );
     329
     330    if (n > UINT32_MAX / sizeof(GLuint) / 4 || !DATA_POINTER_CHECK(20 + n * sizeof(GLuint)))
     331    {
     332        crError("crUnpackExtendAreTexturesResident: %d is out of range", n);
     333        return;
     334    }
     335
    329336    SET_RETURN_PTR(12 + n * sizeof(GLuint));
    330337    SET_WRITEBACK_PTR(20 + n * sizeof(GLuint));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette