OSDN Git Service

GL encoder null pointer check before write
authorYahan Zhou <yahan@google.com>
Fri, 19 Feb 2016 21:59:34 +0000 (13:59 -0800)
committerYahan Zhou <yahan@google.com>
Fri, 19 Feb 2016 23:11:14 +0000 (23:11 +0000)
commit268e85cdbb1122531013598b2638c25b839191ee
tree6eb64aa644a1c44a5e2b827be358d3ba74a7790f
parentd6217a5f991123ade8c325cfa5aeefeedd127057
GL encoder null pointer check before write

Previously when encoding some functions, if the user gives us a null
pointer, the encoder will write a header with some data length while not
actually writing any data. This patch fix it by writing 0 into the data
length field for all those functions.

The changed functions include:
glBufferSubData
glCompressedSubTexImage2D
glTexSubImage3DOES
glCompressedTexImage3DOES
glCompressedTexSubImage3DOES

Other functions do not directly write user's pointer, so they don't need
to be updated.

Since this is auto-generated code, there would be another patch in
emu-master-dev to update the code generator.

Change-Id: I05fca078dfcf01e20fa757f1050820b21ca080b7
system/GLESv1_enc/gl_enc.cpp
system/GLESv2_enc/gl2_enc.cpp