Commit 7dec1a15 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser

Fix a potential infinite loop in QPfile parsing on Windows

ftell doesn't seem to work properly on Windows in text mode.
parent 3667fbf9
......@@ -781,7 +781,7 @@ static int Parse( int argc, char **argv,
}
break;
case OPT_QPFILE:
opt->qpfile = fopen( optarg, "r" );
opt->qpfile = fopen( optarg, "rb" );
if( !opt->qpfile )
{
fprintf( stderr, "x264 [error]: can't open `%s'\n", optarg );
......@@ -1036,7 +1036,7 @@ static void parse_qpfile( cli_opt_t *opt, x264_picture_t *pic, int i_frame )
fseek( opt->qpfile , file_pos , SEEK_SET );
break;
}
if( num < i_frame )
if( num < i_frame && ret == 3 )
continue;
pic->i_qpplus1 = qp+1;
if ( type == 'I' ) pic->i_type = X264_TYPE_IDR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment