mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb/WebGL2: Correctly handle offsets in uniform(Matrix) functions
This commit is contained in:
parent
63b792c205
commit
2983ad10bc
Notes:
github-actions[bot]
2025-01-08 15:00:44 +00:00
Author: https://github.com/Lubrsi
Commit: 2983ad10bc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2943
Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 14 additions and 10 deletions
|
@ -923,14 +923,16 @@ public:
|
||||||
|
|
||||||
if (webgl_version == 2) {
|
if (webgl_version == 2) {
|
||||||
function_impl_generator.append(R"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
|
if (src_offset + src_length > (count * matrix_size)) {
|
||||||
|
set_error(GL_INVALID_VALUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
raw_data += src_offset;
|
raw_data += src_offset;
|
||||||
if (src_length == 0) {
|
if (src_length == 0) {
|
||||||
count -= src_offset;
|
count -= src_offset;
|
||||||
}
|
} else {
|
||||||
|
count = src_length;
|
||||||
if (src_offset + src_length <= count) {
|
|
||||||
set_error(GL_INVALID_VALUE);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
@ -975,14 +977,16 @@ public:
|
||||||
|
|
||||||
if (webgl_version == 2) {
|
if (webgl_version == 2) {
|
||||||
function_impl_generator.append(R"~~~(
|
function_impl_generator.append(R"~~~(
|
||||||
|
if (src_offset + src_length > count) {
|
||||||
|
set_error(GL_INVALID_VALUE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data += src_offset;
|
data += src_offset;
|
||||||
if (src_length == 0) {
|
if (src_length == 0) {
|
||||||
count -= src_offset;
|
count -= src_offset;
|
||||||
}
|
} else {
|
||||||
|
count = src_length;
|
||||||
if (src_offset + src_length <= count) {
|
|
||||||
set_error(GL_INVALID_VALUE);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
)~~~");
|
)~~~");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue