Change tex_adr type to mjtSize.

Adds a test which verifies that we can index into the texture buffer at offsets larger than can be represented by a 32-bit signed int.

PiperOrigin-RevId: 868756646
Change-Id: Ibc1a2b269fce41aec370611b0aab77803837e7a8
This commit is contained in:
Adrian Collister
2026-02-11 11:06:21 -08:00
committed by Copybara-Service
parent 2b5afce4aa
commit d881e9e374
7 changed files with 34 additions and 7 deletions
+1 -1
View File
@@ -1099,7 +1099,7 @@ struct mjModel_ {
int* tex_height; // number of rows in texture image (ntex x 1)
int* tex_width; // number of columns in texture image (ntex x 1)
int* tex_nchannel; // number of channels in texture image (ntex x 1)
int* tex_adr; // start address in tex_data (ntex x 1)
mjtSize* tex_adr; // start address in tex_data (ntex x 1)
mjtByte* tex_data; // pixel values (ntexdata x 1)
int* tex_pathadr; // address of texture asset path; -1: none (ntex x 1)
+1 -1
View File
@@ -581,7 +581,7 @@
X ( int, tex_height, ntex, 1 ) \
X ( int, tex_width, ntex, 1 ) \
X ( int, tex_nchannel, ntex, 1 ) \
X ( int, tex_adr, ntex, 1 ) \
X ( mjtSize, tex_adr, ntex, 1 ) \
XNV ( mjtByte, tex_data, ntexdata, 1 ) \
X ( int, tex_pathadr, ntex, 1 )