Reset staticInfo if static meta fetch fails

Invaild HDR metadata will be fed into encoder, if not reset.

Bug: 262503726
Test: presubmit
Change-Id: I33fba8a568cd195dfac0e438f8cae4a411bd04da
diff --git a/media/codec2/sfplugin/Codec2Buffer.cpp b/media/codec2/sfplugin/Codec2Buffer.cpp
index b9270de..8bd633f 100644
--- a/media/codec2/sfplugin/Codec2Buffer.cpp
+++ b/media/codec2/sfplugin/Codec2Buffer.cpp
@@ -1137,6 +1137,11 @@
             err = C2_CORRUPTED;
         }
     }
+
+    if (err != C2_OK) {
+        staticInfo->reset();
+    }
+
     if (dynamicInfo) {
         ALOGV("Grabbing dynamic HDR info from gralloc4 metadata");
         dynamicInfo->reset();