VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_calllists.cpp@ 78225

Last change on this file since 78225 was 78212, checked in by vboxsync, 6 years ago

HostServices/ShareOpenGL/unpacker: Verification fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.0 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "unpacker.h"
8
9void crUnpackCallLists(PCrUnpackerState pState)
10{
11 CHECK_BUFFER_SIZE_STATIC_LAST(pState, sizeof( int ) + 4, GLenum);
12
13 GLint n = READ_DATA(pState, sizeof( int ) + 0, GLint );
14 GLenum type = READ_DATA(pState, sizeof( int ) + 4, GLenum );
15 GLvoid *lists = DATA_POINTER(pState, sizeof( int ) + 8, GLvoid );
16
17 switch (type)
18 {
19 case GL_BYTE:
20 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLbyte);
21 break;
22 case GL_UNSIGNED_BYTE:
23 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLubyte);
24 break;
25 case GL_SHORT:
26 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLshort);
27 break;
28 case GL_UNSIGNED_SHORT:
29 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLushort);
30 break;
31 case GL_INT:
32 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLint);
33 break;
34 case GL_UNSIGNED_INT:
35 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLuint);
36 break;
37 case GL_FLOAT:
38 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, n, GLfloat);
39 break;
40 case GL_2_BYTES:
41 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, 2 * n, GLbyte);
42 break;
43 case GL_3_BYTES:
44 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, 3 * n, GLbyte);
45 break;
46 case GL_4_BYTES:
47 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, lists, 4 * n, GLbyte);
48 break;
49 default:
50 crError("crUnpackCallLists: Invalid type (%#x) passed!\n", type);
51 pState->rcUnpack = VERR_INVALID_PARAMETER;
52 return;
53 }
54
55 pState->pDispatchTbl->CallLists( n, type, lists );
56 INCR_VAR_PTR(pState);
57}
Note: See TracBrowser for help on using the repository browser.

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