If FFMS_ReadIndex is used with an empty index file it gets stuck in an infinite loop instead of returning NULL
like it's supposed to do on failure. Explicitly check if the file is empty before calling it as a workaround.
{
x264_struct_stat index_s, input_s;
if( !x264_stat( opt->index_file, &index_s ) && !x264_stat( psz_filename, &input_s ) &&
- input_s.st_mtime < index_s.st_mtime )
+ input_s.st_mtime < index_s.st_mtime && index_s.st_size )
idx = FFMS_ReadIndex( idx_filename, &e );
}
if( !idx )