From 7fa4c5e2f0a0e131814c32f414435af32818ab85 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sat, 6 Feb 2010 04:11:53 +0100 Subject: Remove file size limit in ass_read_file If an application wants to provide some sort of safeguard against loading very big files (which can trash memory), it should do so by itself. --- libass/ass.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libass/ass.c b/libass/ass.c index fd63d96..1411776 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -58,7 +58,6 @@ struct parser_priv { #define ASS_STYLES_ALLOC 20 #define ASS_EVENTS_ALLOC 200 -#define ASS_MAX_FILESIZE 50 * 1048576 void ass_free_track(ASS_Track *track) { @@ -1022,14 +1021,6 @@ static char *read_file(ASS_Library *library, char *fname, size_t *bufsize) sz = ftell(fp); rewind(fp); - if (sz > ASS_MAX_FILESIZE) { - ass_msg(library, MSGL_INFO, - "ass_read_file(%s): Refusing to load subtitles " - "larger than %d bytes", fname, ASS_MAX_FILESIZE); - fclose(fp); - return 0; - } - ass_msg(library, MSGL_V, "File size: %ld", sz); buf = malloc(sz + 1); -- cgit v1.2.3