avm2: Handle wrong number of coords when drawing triangles in Graphics
FP throws an error when the number of coordinates is odd for the indexed version, and when is not divisible by 6 for the non-indexed version.
This commit is contained in:
parent
86a3086808
commit
14ac29e435
|
@ -998,6 +998,10 @@ fn draw_triangles_internal<'gc>(
|
|||
.expect("vertices is not a Vector");
|
||||
|
||||
if let Some(indices) = indices {
|
||||
if vertices.length() % 2 != 0 {
|
||||
return Err(make_error_2004(activation, Error2004Type::ArgumentError));
|
||||
}
|
||||
|
||||
let indices = indices
|
||||
.as_vector_storage()
|
||||
.expect("indices is not a Vector");
|
||||
|
@ -1050,6 +1054,10 @@ fn draw_triangles_internal<'gc>(
|
|||
draw_triangle_internal(triangle, drawing, culling);
|
||||
}
|
||||
} else {
|
||||
if vertices.length() % 6 != 0 {
|
||||
return Err(make_error_2004(activation, Error2004Type::ArgumentError));
|
||||
}
|
||||
|
||||
let mut vertices = vertices.iter();
|
||||
|
||||
fn read_point<'gc>(
|
||||
|
|
Loading…
Reference in New Issue