Merge "CCodec: Duplicate format given to CCodecBufferChannel" into rvc-dev am: e241b78536 am: 5291b3926c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/12014034

Change-Id: I0344fc4d0b4ea081bc665c0196ae3793a06982b1
diff --git a/media/codec2/sfplugin/CCodec.cpp b/media/codec2/sfplugin/CCodec.cpp
index 70171fd..73b3857 100644
--- a/media/codec2/sfplugin/CCodec.cpp
+++ b/media/codec2/sfplugin/CCodec.cpp
@@ -1868,7 +1868,7 @@
                 config->mInputSurface->onInputBufferDone(work->input.ordinal.frameIndex);
             }
             mChannel->onWorkDone(
-                    std::move(work), changed ? config->mOutputFormat : nullptr,
+                    std::move(work), changed ? config->mOutputFormat->dup() : nullptr,
                     initData.hasChanged() ? initData.update().get() : nullptr);
             break;
         }