- Timestamp:
- May 28, 2019 2:06:43 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_texture.cpp
r78817 r78820 302 302 void crUnpackTexSubImage3D(PCrUnpackerState pState) 303 303 { 304 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 40, int);305 306 GLenum target = READ_DATA(pState, 0, GLenum);307 GLint level = READ_DATA(pState, 4, GLint);308 GLint xoffset = READ_DATA(pState, 8, GLint);309 GLint yoffset = READ_DATA(pState, 12, GLint);310 GLint zoffset = READ_DATA(pState, 16, GLint);311 GLsizei width = READ_DATA(pState, 20, GLsizei);312 GLsizei height = READ_DATA(pState, 24, GLsizei);313 GLsizei depth = READ_DATA(pState, 28, GLsizei);314 GLenum format = READ_DATA(pState, 32, GLenum);315 GLenum type = READ_DATA(pState, 36, GLenum);316 int noimagedata = READ_DATA(pState, 40, int);317 GLvoid *pixels; 318 319 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 44, GLint);304 CHECK_BUFFER_SIZE_STATIC_LAST(pState, sizeof(int) + 40, int); 305 306 GLenum target = READ_DATA(pState, sizeof( int ) + 0, GLenum ); 307 GLint level = READ_DATA(pState, sizeof( int ) + 4, GLint ); 308 GLint xoffset = READ_DATA(pState, sizeof( int ) + 8, GLint ); 309 GLint yoffset = READ_DATA(pState, sizeof( int ) + 12, GLint ); 310 GLint zoffset = READ_DATA(pState, sizeof( int ) + 16, GLint ); 311 GLsizei width = READ_DATA(pState, sizeof( int ) + 20, GLsizei ); 312 GLsizei height = READ_DATA(pState, sizeof( int ) + 24, GLsizei ); 313 GLsizei depth = READ_DATA(pState, sizeof( int ) + 28, GLsizei ); 314 GLenum format = READ_DATA(pState, sizeof( int ) + 32, GLenum ); 315 GLenum type = READ_DATA(pState, sizeof( int ) + 36, GLenum ); 316 int noimagedata = READ_DATA(pState, sizeof( int ) + 40, int ); 317 GLvoid *pixels; 318 319 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, sizeof(int)+44, GLint); 320 320 if ( noimagedata ) 321 pixels = (void*) (uintptr_t) READ_DATA(pState, 44, GLint);321 pixels = (void*) (uintptr_t) READ_DATA(pState, sizeof(int)+44, GLint); 322 322 else 323 323 { … … 328 328 return; 329 329 } 330 pixels = DATA_POINTER(pState, 48, GLvoid );330 pixels = DATA_POINTER(pState, sizeof( int ) + 48, GLvoid ); 331 331 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, cbImg, GLubyte); 332 332 } … … 345 345 void crUnpackTexSubImage2D(PCrUnpackerState pState) 346 346 { 347 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 32, int);348 349 GLenum target = READ_DATA(pState, 0, GLenum);350 GLint level = READ_DATA(pState, 4, GLint);351 GLint xoffset = READ_DATA(pState, 8, GLint);352 GLint yoffset = READ_DATA(pState, 12, GLint);353 GLsizei width = READ_DATA(pState, 16, GLsizei);354 GLsizei height = READ_DATA(pState, 20, GLsizei);355 GLenum format = READ_DATA(pState, 24, GLenum);356 GLenum type = READ_DATA(pState, 28, GLenum);357 int noimagedata = READ_DATA(pState, 32, int);358 GLvoid *pixels; 359 360 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 36, GLint);347 CHECK_BUFFER_SIZE_STATIC_LAST(pState, sizeof(int) + 32, int); 348 349 GLenum target = READ_DATA(pState, sizeof( int ) + 0, GLenum ); 350 GLint level = READ_DATA(pState, sizeof( int ) + 4, GLint ); 351 GLint xoffset = READ_DATA(pState, sizeof( int ) + 8, GLint ); 352 GLint yoffset = READ_DATA(pState, sizeof( int ) + 12, GLint ); 353 GLsizei width = READ_DATA(pState, sizeof( int ) + 16, GLsizei ); 354 GLsizei height = READ_DATA(pState, sizeof( int ) + 20, GLsizei ); 355 GLenum format = READ_DATA(pState, sizeof( int ) + 24, GLenum ); 356 GLenum type = READ_DATA(pState, sizeof( int ) + 28, GLenum ); 357 int noimagedata = READ_DATA(pState, sizeof( int ) + 32, int ); 358 GLvoid *pixels; 359 360 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, sizeof(int)+36, GLint); 361 361 if ( noimagedata ) 362 362 { 363 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 36, GLint);364 pixels = (void*) (uintptr_t) READ_DATA(pState, 36, GLint);363 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, sizeof(int)+36, GLint); 364 pixels = (void*) (uintptr_t) READ_DATA(pState, sizeof(int)+36, GLint); 365 365 } 366 366 else … … 372 372 return; 373 373 } 374 pixels = DATA_POINTER(pState, 40, GLvoid );374 pixels = DATA_POINTER(pState, sizeof( int ) + 40, GLvoid ); 375 375 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, cbImg, GLubyte); 376 376 } … … 388 388 void crUnpackTexSubImage1D(PCrUnpackerState pState) 389 389 { 390 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 24, int);391 392 GLenum target = READ_DATA(pState, 0, GLenum);393 GLint level = READ_DATA(pState, 4, GLint);394 GLint xoffset = READ_DATA(pState, 8, GLint);395 GLsizei width = READ_DATA(pState, 12, GLsizei);396 GLenum format = READ_DATA(pState, 16, GLenum);397 GLenum type = READ_DATA(pState, 20, GLenum);398 int noimagedata = READ_DATA(pState, 24, int);399 GLvoid *pixels; 400 401 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 28, GLint);390 CHECK_BUFFER_SIZE_STATIC_LAST(pState, sizeof(int) + 24, int); 391 392 GLenum target = READ_DATA(pState, sizeof( int ) + 0, GLenum ); 393 GLint level = READ_DATA(pState, sizeof( int ) + 4, GLint ); 394 GLint xoffset = READ_DATA(pState, sizeof( int ) + 8, GLint ); 395 GLsizei width = READ_DATA(pState, sizeof( int ) + 12, GLsizei ); 396 GLenum format = READ_DATA(pState, sizeof( int ) + 16, GLenum ); 397 GLenum type = READ_DATA(pState, sizeof( int ) + 20, GLenum ); 398 int noimagedata = READ_DATA(pState, sizeof( int ) + 24, int ); 399 GLvoid *pixels; 400 401 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, sizeof(int)+28, GLint); 402 402 if ( noimagedata ) 403 pixels = (void*) (uintptr_t) READ_DATA(pState, 28, GLint);403 pixels = (void*) (uintptr_t) READ_DATA(pState, sizeof(int)+28, GLint); 404 404 else 405 405 { … … 410 410 return; 411 411 } 412 pixels = DATA_POINTER(pState, 32, GLvoid );412 pixels = DATA_POINTER(pState, sizeof( int ) + 32, GLvoid ); 413 413 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, cbImg, GLubyte); 414 414 } … … 527 527 void crUnpackExtendCompressedTexImage3DARB(PCrUnpackerState pState) 528 528 { 529 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 32, int);530 531 GLenum target = READ_DATA(pState, 4 + 0, GLenum);532 GLint level = READ_DATA(pState, 4 + 4, GLint);533 GLenum internalformat = READ_DATA(pState, 4 + 8, GLenum);534 GLsizei width = READ_DATA(pState, 4 + 12, GLsizei);535 GLsizei height = READ_DATA(pState, 4 + 16, GLsizei);536 GLsizei depth = READ_DATA(pState, 4 + 20, GLsizei);537 GLint border = READ_DATA(pState, 4 + 24, GLint);538 GLsizei imagesize = READ_DATA(pState, 4 + 28, GLsizei);539 int noimagedata = READ_DATA(pState, 4 + 32, int);529 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 32, int); 530 531 GLenum target = READ_DATA(pState, 4 + sizeof(int) + 0, GLenum ); 532 GLint level = READ_DATA(pState, 4 + sizeof(int) + 4, GLint ); 533 GLenum internalformat = READ_DATA(pState, 4 + sizeof(int) + 8, GLenum ); 534 GLsizei width = READ_DATA(pState, 4 + sizeof(int) + 12, GLsizei ); 535 GLsizei height = READ_DATA(pState, 4 + sizeof(int) + 16, GLsizei ); 536 GLsizei depth = READ_DATA(pState, 4 + sizeof(int) + 20, GLsizei ); 537 GLint border = READ_DATA(pState, 4 + sizeof(int) + 24, GLint ); 538 GLsizei imagesize = READ_DATA(pState, 4 + sizeof(int) + 28, GLsizei ); 539 int noimagedata = READ_DATA(pState, 4 + sizeof(int) + 32, int ); 540 540 GLvoid *pixels; 541 541 542 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 36, GLint);542 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+36, GLint); 543 543 if( noimagedata ) 544 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +36, GLint);545 else 546 { 547 pixels = DATA_POINTER(pState, 4 + 40, GLvoid );544 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+36, GLint); 545 else 546 { 547 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 40, GLvoid ); 548 548 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 549 549 } … … 557 557 void crUnpackExtendCompressedTexImage2DARB(PCrUnpackerState pState) 558 558 { 559 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 28, int);560 561 GLenum target = READ_DATA(pState, 4 + 0, GLenum);562 GLint level = READ_DATA(pState, 4 + 4, GLint);563 GLenum internalformat = READ_DATA(pState, 4 + 8, GLenum);564 GLsizei width = READ_DATA(pState, 4 + 12, GLsizei);565 GLsizei height = READ_DATA(pState, 4 + 16, GLsizei);566 GLint border = READ_DATA(pState, 4 + 20, GLint);567 GLsizei imagesize = READ_DATA(pState, 4 + 24, GLsizei);568 int noimagedata = READ_DATA(pState, 4 + 28, int);569 GLvoid *pixels; 570 571 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 32, GLint);559 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 28, int); 560 561 GLenum target = READ_DATA(pState, 4 + sizeof( int ) + 0, GLenum ); 562 GLint level = READ_DATA(pState, 4 + sizeof( int ) + 4, GLint ); 563 GLenum internalformat = READ_DATA(pState, 4 + sizeof( int ) + 8, GLenum ); 564 GLsizei width = READ_DATA(pState, 4 + sizeof( int ) + 12, GLsizei ); 565 GLsizei height = READ_DATA(pState, 4 + sizeof( int ) + 16, GLsizei ); 566 GLint border = READ_DATA(pState, 4 + sizeof( int ) + 20, GLint ); 567 GLsizei imagesize = READ_DATA(pState, 4 + sizeof( int ) + 24, GLsizei ); 568 int noimagedata = READ_DATA(pState, 4 + sizeof( int ) + 28, int ); 569 GLvoid *pixels; 570 571 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+32, GLint); 572 572 if ( noimagedata ) 573 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +32, GLint);574 else 575 { 576 pixels = DATA_POINTER(pState, 4 + 36, GLvoid );573 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+32, GLint); 574 else 575 { 576 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 36, GLvoid ); 577 577 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 578 578 } … … 586 586 void crUnpackExtendCompressedTexImage1DARB(PCrUnpackerState pState) 587 587 { 588 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 24, int);589 590 GLenum target = READ_DATA(pState, 4 + 0, GLenum);591 GLint level = READ_DATA(pState, 4 + 4, GLint);592 GLenum internalformat = READ_DATA(pState, 4 + 8, GLenum);593 GLsizei width = READ_DATA(pState, 4 + 12, GLsizei);594 GLint border = READ_DATA(pState, 4 + 16, GLint);595 GLsizei imagesize = READ_DATA(pState, 4 + 20, GLsizei);596 int noimagedata = READ_DATA(pState, 4 + 24, int);588 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 24, int); 589 590 GLenum target = READ_DATA(pState, 4 + sizeof(int) + 0, GLenum ); 591 GLint level = READ_DATA(pState, 4 + sizeof(int) + 4, GLint ); 592 GLenum internalformat = READ_DATA(pState, 4 + sizeof(int) + 8, GLenum ); 593 GLsizei width = READ_DATA(pState, 4 + sizeof(int) + 12, GLsizei ); 594 GLint border = READ_DATA(pState, 4 + sizeof(int) + 16, GLint ); 595 GLsizei imagesize = READ_DATA(pState, 4 + sizeof(int) + 20, GLsizei ); 596 int noimagedata = READ_DATA(pState, 4 + sizeof(int) + 24, int ); 597 597 GLvoid *pixels; 598 598 599 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 28, GLint);599 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+28, GLint); 600 600 if( noimagedata ) 601 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +28, GLint);602 else 603 { 604 pixels = DATA_POINTER(pState, 4 + 32, GLvoid );601 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+28, GLint); 602 else 603 { 604 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 32, GLvoid ); 605 605 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 606 606 } … … 613 613 void crUnpackExtendCompressedTexSubImage3DARB(PCrUnpackerState pState) 614 614 { 615 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 40, int);616 617 GLenum target = READ_DATA(pState, 4 + 0, GLenum );618 GLint level = READ_DATA(pState, 4 + 4, GLint );619 GLint xoffset = READ_DATA(pState, 4 + 8, GLint );620 GLint yoffset = READ_DATA(pState, 4 + 12, GLint );621 GLint zoffset = READ_DATA(pState, 4 + 16, GLint );622 GLsizei width = READ_DATA(pState, 4 + 20, GLsizei );623 GLsizei height = READ_DATA(pState, 4 + 24, GLsizei );624 GLsizei depth = READ_DATA(pState, 4 + 28, GLsizei );625 GLenum format = READ_DATA(pState, 4 + 32, GLenum );626 GLsizei imagesize = READ_DATA(pState, 4 + 36, GLsizei );627 int noimagedata = READ_DATA(pState, 4 + 40, int );615 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 40, int); 616 617 GLenum target = READ_DATA(pState, 4 + sizeof(int) + 0, GLenum ); 618 GLint level = READ_DATA(pState, 4 + sizeof(int) + 4, GLint ); 619 GLint xoffset = READ_DATA(pState, 4 + sizeof(int) + 8, GLint ); 620 GLint yoffset = READ_DATA(pState, 4 + sizeof(int) + 12, GLint ); 621 GLint zoffset = READ_DATA(pState, 4 + sizeof(int) + 16, GLint ); 622 GLsizei width = READ_DATA(pState, 4 + sizeof(int) + 20, GLsizei ); 623 GLsizei height = READ_DATA(pState, 4 + sizeof(int) + 24, GLsizei ); 624 GLsizei depth = READ_DATA(pState, 4 + sizeof(int) + 28, GLsizei ); 625 GLenum format = READ_DATA(pState, 4 + sizeof(int) + 32, GLenum ); 626 GLsizei imagesize = READ_DATA(pState, 4 + sizeof(int) + 36, GLsizei ); 627 int noimagedata = READ_DATA(pState, 4 + sizeof(int) + 40, int ); 628 628 GLvoid *pixels; 629 629 630 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 44, GLint);630 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+44, GLint); 631 631 if( noimagedata ) 632 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +44, GLint);633 else 634 { 635 pixels = DATA_POINTER(pState, 4 + 48, GLvoid );632 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+44, GLint); 633 else 634 { 635 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 48, GLvoid ); 636 636 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 637 637 } … … 646 646 void crUnpackExtendCompressedTexSubImage2DARB(PCrUnpackerState pState) 647 647 { 648 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 32, int);649 650 GLenum target = READ_DATA(pState, 4 + 0, GLenum);651 GLint level = READ_DATA(pState, 4 + 4, GLint);652 GLint xoffset = READ_DATA(pState, 4 + 8, GLint);653 GLint yoffset = READ_DATA(pState, 4 + 12, GLint);654 GLsizei width = READ_DATA(pState, 4 + 16, GLsizei);655 GLsizei height = READ_DATA(pState, 4 + 20, GLsizei);656 GLenum format = READ_DATA(pState, 4 + 24, GLenum);657 GLsizei imagesize = READ_DATA(pState, 4 + 28, GLsizei);658 int noimagedata = READ_DATA(pState, 4 + 32, int);648 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 32, int); 649 650 GLenum target = READ_DATA(pState, 4 + sizeof(int) + 0, GLenum ); 651 GLint level = READ_DATA(pState, 4 + sizeof(int) + 4, GLint ); 652 GLint xoffset = READ_DATA(pState, 4 + sizeof(int) + 8, GLint ); 653 GLint yoffset = READ_DATA(pState, 4 + sizeof(int) + 12, GLint ); 654 GLsizei width = READ_DATA(pState, 4 + sizeof(int) + 16, GLsizei ); 655 GLsizei height = READ_DATA(pState, 4 + sizeof(int) + 20, GLsizei ); 656 GLenum format = READ_DATA(pState, 4 + sizeof(int) + 24, GLenum ); 657 GLsizei imagesize = READ_DATA(pState, 4 + sizeof(int) + 28, GLsizei ); 658 int noimagedata = READ_DATA(pState, 4 + sizeof(int) + 32, int ); 659 659 GLvoid *pixels; 660 660 661 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 36, GLint);661 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+36, GLint); 662 662 if( noimagedata ) 663 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +36, GLint);664 else 665 { 666 pixels = DATA_POINTER(pState, 4 + 40, GLvoid );663 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+36, GLint); 664 else 665 { 666 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 40, GLvoid ); 667 667 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 668 668 } … … 676 676 void crUnpackExtendCompressedTexSubImage1DARB(PCrUnpackerState pState) 677 677 { 678 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + 24, int);679 680 GLenum target = READ_DATA(pState, 4 + 0, GLenum);681 GLint level = READ_DATA(pState, 4 + 4, GLint);682 GLint xoffset = READ_DATA(pState, 4 + 8, GLint);683 GLsizei width = READ_DATA(pState, 4 + 12, GLsizei);684 GLenum format = READ_DATA(pState, 4 + 16, GLenum);685 GLsizei imagesize = READ_DATA(pState, 4 + 20, GLsizei);686 int noimagedata = READ_DATA(pState, 4 + 24, int);678 CHECK_BUFFER_SIZE_STATIC_LAST(pState, 4 + sizeof(int) + 24, int); 679 680 GLenum target = READ_DATA(pState, 4 + sizeof(int) + 0, GLenum ); 681 GLint level = READ_DATA(pState, 4 + sizeof(int) + 4, GLint ); 682 GLint xoffset = READ_DATA(pState, 4 + sizeof(int) + 8, GLint ); 683 GLsizei width = READ_DATA(pState, 4 + sizeof(int) + 12, GLsizei ); 684 GLenum format = READ_DATA(pState, 4 + sizeof(int) + 16, GLenum ); 685 GLsizei imagesize = READ_DATA(pState, 4 + sizeof(int) + 20, GLsizei ); 686 int noimagedata = READ_DATA(pState, 4 + sizeof(int) + 24, int ); 687 687 GLvoid *pixels; 688 688 689 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + 28, GLint);689 CHECK_BUFFER_SIZE_STATIC_UPDATE_LAST(pState, 4 + sizeof(int)+28, GLint); 690 690 if( noimagedata ) 691 pixels = (void*) (uintptr_t) READ_DATA(pState, 4 +28, GLint);692 else 693 { 694 pixels = DATA_POINTER(pState, 4 + 32, GLvoid );691 pixels = (void*) (uintptr_t) READ_DATA(pState, 4+sizeof(int)+28, GLint); 692 else 693 { 694 pixels = DATA_POINTER(pState, 4 + sizeof( int ) + 32, GLvoid ); 695 695 CHECK_ARRAY_SIZE_FROM_PTR_UPDATE_LAST(pState, pixels, imagesize, GLubyte); 696 696 }
Note:
See TracChangeset
for help on using the changeset viewer.