VirtualBox

Changeset 21854 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Jul 28, 2009 3:55:07 PM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: ignore gldrawpixels with incorrect type/format

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/packer/pack_pixels.c

    r21853 r21854  
    1818{
    1919    unsigned char *data_ptr;
    20     int packet_length;
     20    int packet_length, imagesize;
    2121
    2222    if (pixels == NULL)
     
    4040        sizeof( type );
    4141
    42     packet_length += crImageSize( format, type, width, height );
     42    imagesize = crImageSize( format, type, width, height );
     43
     44    if (imagesize<=0)
     45    {
     46        crDebug("crPackDrawPixels: 0 image size, ignoring");
     47        return;
     48    }
     49
     50    packet_length += imagesize;
    4351
    4452    data_ptr = (unsigned char *) crPackAlloc( packet_length );
  • trunk/src/VBox/GuestHost/OpenGL/util/pixel.c

    r16748 r21854  
    102102            break;
    103103        default:
    104             /*
    105             crError( "Unknown pixel type in crPixelSize: 0x%x", (unsigned int) type );
    106             */
    107             return -1;
     104            crWarning( "Unknown pixel type in crPixelSize: type:0x%x(fmt:0x%x)", (unsigned int) type, (unsigned int) format);
     105            return 0;
    108106    }
    109107
     
    138136            break;
    139137        default:
    140             /*
    141             crError( "Unknown pixel format in crPixelSize: 0x%x", (unsigned int) format );
    142             */
    143             return -1;
     138            crWarning( "Unknown pixel format in crPixelSize: type:0x%x(fmt:0x%x)", (unsigned int) type, (unsigned int) format);
     139            return 0;
    144140    }
    145141
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