[x264-devel] Workaround for FFMS indexing bug
Henrik Gramner
git at videolan.org
Wed Oct 30 21:18:31 CET 2013
x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Wed Aug 28 00:50:31 2013 +0200| [dfdb6465dea2990a4531d076ed2644c8ccb0f3a9] | committer: Jason Garrett-Glaser
Workaround for FFMS indexing bug
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.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=dfdb6465dea2990a4531d076ed2644c8ccb0f3a9
---
input/ffms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/input/ffms.c b/input/ffms.c
index 054728b..5c80fd9 100644
--- a/input/ffms.c
+++ b/input/ffms.c
@@ -105,7 +105,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
{
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 )
More information about the x264-devel
mailing list