mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Catch degenerate ISOBMFF matrices
This commit is contained in:
@@ -2755,7 +2755,14 @@ const extractRotationFromMatrix = (matrix: TransformationMatrix) => {
|
||||
const sinTheta = m21 / scaleX;
|
||||
|
||||
// Invert the rotation because matrices are post-multiplied in ISOBMFF
|
||||
return -Math.atan2(sinTheta, cosTheta) * (180 / Math.PI);
|
||||
const result = -Math.atan2(sinTheta, cosTheta) * (180 / Math.PI);
|
||||
|
||||
if (!Number.isFinite(result)) {
|
||||
// Can happen if the entire matrix is 0, for example
|
||||
return 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
const sampleTableIsEmpty = (sampleTable: SampleTable) => {
|
||||
|
||||
Reference in New Issue
Block a user