Fix condition with trim paths where all contours are 0 length.

Fixes a crash which would occur when trying to extract segments from a path with 0 length. This would occur when scale was set to zero (via animation or otherwise). Adds a test which recreates the condition. Prior to the fix the test would crash.

Issue discussed in Slack here: https://2dimensions.slack.com/archives/CLLCU09T6/p1674648327503309

Diffs=
42a0377bc Fix condition with trim paths where all contours are 0 length. (#4722)
diff --git a/.rive_head b/.rive_head
index b8230be..8f0cdc3 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-ea1c83d025d5991567973478df416e64f6888ad4
+42a0377bcfb346abf8b60fa5fe0372ec701aad8b
diff --git a/src/shapes/metrics_path.cpp b/src/shapes/metrics_path.cpp
index 81642bf..f93796b 100644
--- a/src/shapes/metrics_path.cpp
+++ b/src/shapes/metrics_path.cpp
@@ -61,7 +61,11 @@
         m_Paths.front()->trim(startLength, endLength, moveTo, result);
         return;
     }
-
+    if (!m_Contour)
+    {
+        // All the contours were 0 length, so there's nothing to segment.
+        return;
+    }
     // TODO: if we can change the signature of MetricsPath and/or trim() to speak native
     //       rawpaths, we wouldn't need this temporary copy (since ContourMeasure speaks
     //       native rawpaths).
diff --git a/test/assets/trim.riv b/test/assets/trim.riv
new file mode 100644
index 0000000..bd95852
--- /dev/null
+++ b/test/assets/trim.riv
Binary files differ
diff --git a/test/trim_test.cpp b/test/trim_test.cpp
new file mode 100644
index 0000000..1e59d0e
--- /dev/null
+++ b/test/trim_test.cpp
@@ -0,0 +1,32 @@
+#include <rive/file.hpp>
+#include <rive/node.hpp>
+#include <rive/shapes/rectangle.hpp>
+#include <rive/shapes/shape.hpp>
+#include <rive/shapes/paint/stroke.hpp>
+#include <rive/shapes/paint/solid_color.hpp>
+#include <rive/shapes/paint/color.hpp>
+#include <utils/no_op_renderer.hpp>
+#include "rive_file_reader.hpp"
+#include <catch.hpp>
+#include <cstdio>
+
+TEST_CASE("A 0 scale path will trim with no crash", "[file]")
+{
+    auto file = ReadRiveFile("../../test/assets/trim.riv");
+
+    auto artboard = file->artboard();
+    auto node = artboard->find<rive::Node>("I");
+    REQUIRE(node != nullptr);
+    REQUIRE(node->scaleX() != 0);
+    REQUIRE(node->scaleY() != 0);
+    artboard->advance(0.0f);
+
+    rive::NoOpRenderer renderer;
+    artboard->draw(&renderer);
+
+    // Now set scale to 0 and make sure it doesn't crash.
+    node->scaleX(0.0f);
+    node->scaleY(0.0f);
+    artboard->advance(0.0f);
+    artboard->draw(&renderer);
+}