You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.
set the advanced substation subtitle (.ass) PlayResX or PlayResY property to 0 in Aegisub and save the file. Or you can edit the .ass file directly, i.e. PlayResX: 0.
use libjass to render that subtitle file via URL or by directly using the text of the .ass file.
Identification of problem:
Libjass uses property PlayResX and PlayResY for scaling of the rendering of effects in CSS, for example _textShadow. The way they are defined is by element width / PlayResX and element height / PlayResY, creating the possibility of a divide by zero condition. Since Javascript defines n / 0 as Infinity, and Libjass tries to setup a for() loop with that number as the break condition, we will run out of memory abruptly.
To reproduce:
PlayResX: 0
.Identification of problem:
Libjass uses property PlayResX and PlayResY for scaling of the rendering of effects in CSS, for example _textShadow. The way they are defined is by
element width / PlayResX
andelement height / PlayResY
, creating the possibility of a divide by zero condition. Since Javascript definesn / 0
asInfinity
, and Libjass tries to setup a for() loop with that number as the break condition, we will run out of memory abruptly.Proposed solution:
Line 346 of renderer.ts:
if (this.ass.properties.resolutionX === 0 || this.ass.properties.resolutionY === 0) { this._scaleX = 0; this._scaleY = 0; } else { this._scaleX = width / this.ass.properties.resolutionX; this._scaleY = height / this.ass.properties.resolutionY; }
The text was updated successfully, but these errors were encountered: