]> granicus.if.org Git - libass/commitdiff
Remove file size limit in ass_read_file
authorGrigori Goronzy <greg@blackbox>
Sat, 6 Feb 2010 03:11:53 +0000 (04:11 +0100)
committerGrigori Goronzy <greg@blackbox>
Sat, 6 Feb 2010 03:11:53 +0000 (04:11 +0100)
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

index fd63d96a8dfa1791f2c26da3ab2f6670315064f5..14117764dd79261f02e595d84c8e7a2ca715ad0f 100644 (file)
@@ -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);