1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Limit max size of a single fallback font file for ASS to 20 MB

It used to be limited to 20 MB total previously. We cannot easily limit total size of fonts anymore, so the least we can do is to keep the size of a single font file in check.
This commit is contained in:
p0358 2024-09-28 18:11:59 +02:00
parent 792dee44e2
commit d821ad3562
No known key found for this signature in database
GPG key ID: F2FFD05F552EFC00

View file

@ -1304,6 +1304,7 @@ export class HtmlVideoPlayer {
const availableFonts = {};
fontFiles.forEach(font => {
if (!font.FamilyName) return;
if (font.Size > 20 * 1024 * 1024) return; // max 20 MB for any single font file
const familyNameLower = font.FamilyName.trim().toLowerCase();
if (!(familyNameLower in availableFonts)) {
const fontUrl = apiClient.getUrl(`/FallbackFont/Fonts/${encodeURIComponent(font.Name)}`, {