avformat/ifv: Check for EOF in read_index()