wiener_test: ensure [hv]_start < [hv]_end

this avoids trying to obtain an invalid average in compute_stats_opt_c

w/clang -fsanitize=integer fixes:
av1/encoder/pickrst.h:40:24: runtime error: implicit conversion from
type 'int' of value -36942 (32-bit, signed) to type 'unsigned long'
changed the value to 18446744073709514674 (64-bit, unsigned)

Bug: aomedia:3136
Bug: b/229626362
Change-Id: I89140b7705153241d13f312acaa4de2a19231f09
diff --git a/test/wiener_test.cc b/test/wiener_test.cc
index 69df5ea..d44dd92 100644
--- a/test/wiener_test.cc
+++ b/test/wiener_test.cc
@@ -10,6 +10,7 @@
  */
 
 #include <tuple>
+#include <utility>
 #include <vector>
 
 #include "third_party/googletest/src/googletest/include/gtest/gtest.h"
@@ -221,10 +222,12 @@
   // will always be multiples of 64 when called from non-test code.
   // If in future any new requirements are added, these lines will
   // need changing.
-  const int h_start = (rng_.Rand16() % (MAX_WIENER_BLOCK / 2)) & ~1;
+  int h_start = (rng_.Rand16() % (MAX_WIENER_BLOCK / 2)) & ~1;
   int h_end = run_times != 1 ? 256 : (rng_.Rand16() % MAX_WIENER_BLOCK);
-  const int v_start = rng_.Rand16() % (MAX_WIENER_BLOCK / 2);
+  if (h_start > h_end) std::swap(h_start, h_end);
+  int v_start = rng_.Rand16() % (MAX_WIENER_BLOCK / 2);
   int v_end = run_times != 1 ? 256 : (rng_.Rand16() % MAX_WIENER_BLOCK);
+  if (v_start > v_end) std::swap(v_start, v_end);
   const int dgd_stride = h_end;
   const int src_stride = MAX_DATA_BLOCK;
   const int iters = run_times == 1 ? kIterations : 2;
@@ -551,10 +554,12 @@
   // will always be multiples of 64 when called from non-test code.
   // If in future any new requirements are added, these lines will
   // need changing.
-  const int h_start = (rng_.Rand16() % (MAX_WIENER_BLOCK / 2)) & ~1;
+  int h_start = (rng_.Rand16() % (MAX_WIENER_BLOCK / 2)) & ~1;
   int h_end = run_times != 1 ? 256 : (rng_.Rand16() % MAX_WIENER_BLOCK);
-  const int v_start = rng_.Rand16() % (MAX_WIENER_BLOCK / 2);
+  if (h_start > h_end) std::swap(h_start, h_end);
+  int v_start = rng_.Rand16() % (MAX_WIENER_BLOCK / 2);
   int v_end = run_times != 1 ? 256 : (rng_.Rand16() % MAX_WIENER_BLOCK);
+  if (v_start > v_end) std::swap(v_start, v_end);
   const int dgd_stride = h_end;
   const int src_stride = MAX_DATA_BLOCK;
   const int iters = run_times == 1 ? kIterations : 2;