diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c index 50b88c35c2..e22748a005 100644 --- a/sys/msdk/gstmsdkdec.c +++ b/sys/msdk/gstmsdkdec.c @@ -1067,7 +1067,11 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) if (bitstream.DataLength == 0) { flow = GST_FLOW_OK; - surface = NULL; + + /* Don't release it if the current surface is in use */ + if (surface && task->surface == surface->surface) + surface = NULL; + break; } } else if (status == MFX_ERR_MORE_DATA) {