diff --git a/cpp/src/io/orc/aggregate_orc_metadata.cpp b/cpp/src/io/orc/aggregate_orc_metadata.cpp index 3d43042842f..a4ae9999a19 100644 --- a/cpp/src/io/orc/aggregate_orc_metadata.cpp +++ b/cpp/src/io/orc/aggregate_orc_metadata.cpp @@ -172,9 +172,10 @@ std::vector aggregate_orc_metadata::select_stri // Coalesce stripe info at the source file later since that makes downstream processing much // easier in impl::read for (const auto& stripe_idx : user_specified_stripes[src_file_idx]) { - CUDF_EXPECTS(stripe_idx < static_cast( - per_file_metadata[src_file_idx].ff.stripes.size()), - "Invalid stripe index"); + CUDF_EXPECTS( + stripe_idx >= 0 and stripe_idx < static_cast( + per_file_metadata[src_file_idx].ff.stripes.size()), + "Invalid stripe index"); stripe_infos.push_back( std::make_pair(&per_file_metadata[src_file_idx].ff.stripes[stripe_idx], nullptr)); row_count += per_file_metadata[src_file_idx].ff.stripes[stripe_idx].numberOfRows;