diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index 976aae08bb0a7ec5ccf7ba49e2411a5bc08c6b1c..48e876429dfaac10b7e3085c3d4eb1324aa3b7ec 100644
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -38,6 +38,7 @@
 #include "llimagetga.h"
 #include "llimagej2c.h"
 #include "lldir.h"
+#include "lldiriterator.h"
 
 // system libraries
 #include <iostream>
@@ -201,7 +202,8 @@ void store_input_file(std::list<std::string> &input_filenames, const std::string
 	{
 		// If file name is a pattern, iterate to get each file name and store
 		std::string next_name;
-		while (gDirUtilp->getNextFileInDir(dir,name,next_name))
+		LLDirIterator iter(dir, name);
+		while (iter.next(next_name))
 		{
 			std::string file_name = dir + gDirUtilp->getDirDelimiter() + next_name;
 			input_filenames.push_back(file_name);