From: Grigori Goronzy Date: Sat, 6 Feb 2010 03:11:53 +0000 (+0100) Subject: Remove file size limit in ass_read_file X-Git-Tag: 0.9.9~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fa4c5e2f0a0e131814c32f414435af32818ab85;p=libass 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. --- 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);