Only derive capture app type if input stream is available

This addresses a runtime crash on msm8998 devices associated with
USECASE_AUDIO_SPKR_CALIB_TX (Speaker protection).

Bug: 62665965
Test: Validated audio playback works.
Change-Id: I3d3672ca817b6a3e7338fa439dec9f7fe3e2438d
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 2fc424c..4ee4c23 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -214,6 +214,9 @@
                                        int *app_type,
                                        int *sample_rate)
 {
+    if (usecase->stream.in == NULL) {
+        return -1;
+    }
     struct stream_in *in = usecase->stream.in;
     struct stream_app_type_cfg *app_type_cfg = &in->app_type_cfg;
 
@@ -264,6 +267,9 @@
                                         int *app_type,
                                         int *sample_rate)
 {
+    if (usecase->stream.out == NULL) {
+        return -1;
+    }
     struct stream_out *out = usecase->stream.out;
     struct stream_app_type_cfg *app_type_cfg = &out->app_type_cfg;