VirtualBox

Changeset 43901 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Nov 16, 2012 5:28:53 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: set shader source fix

File:
1 edited

Legend:

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

    r37393 r43901  
    5353    for (i=0; i<count; ++i)
    5454    {
    55         pLocalLength[i] = (length && (length[i]>=0)) ? length[i] : crStrlen(string[i])+1;
     55        pLocalLength[i] = ((length && (length[i]>=0)) ? length[i] : crStrlen(string[i]))+1;
    5656        packet_length += pLocalLength[i];
    5757    }
     
    8181        if (string[i])
    8282        {
    83             crMemcpy(data_ptr, string[i], pLocalLength[i]);
     83            if (length && (length[i]>=0))
     84            {
     85                /* include \0 in the string to make intel drivers happy */
     86                crMemcpy(data_ptr, string[i], pLocalLength[i] - 1);
     87                data_ptr[pLocalLength[i] - 1] = '\0';
     88            }
     89            else
     90            {
     91                /* the \0 s already in the string */
     92                crMemcpy(data_ptr, string[i], pLocalLength[i]);
     93            }
    8494        }
    8595        else
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