From b86b4e6294ed5130d1aadc8bc1798fea04a69022 Mon Sep 17 00:00:00 2001 From: Bossonor Date: Wed, 20 Dec 2023 10:28:36 +0800 Subject: [PATCH] [Encode] Fix unchecked return issue * [Encode] Fix unchecked return issue Fix coverity unchecked return issue --- .../pipeline/encode_av1_vdenc_pipeline_xe_hpm.cpp | 10 +++++----- .../encode_av1_vdenc_pipeline_xe_m_base.cpp | 8 ++++---- .../encode_av1_vdenc_pipeline_xe_lpm_plus.cpp | 6 +++--- .../encode_vp9_vdenc_pipeline_xe_lpm_plus.cpp | 14 +++++++------- .../encode_vp9_vdenc_pipeline_xe_lpm_plus_base.cpp | 14 +++++++------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/media_driver/media_softlet/agnostic/Xe_M/Xe_HPM/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_hpm.cpp b/media_driver/media_softlet/agnostic/Xe_M/Xe_HPM/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_hpm.cpp index 600f5f3f0d4..e8bc42818a7 100644 --- a/media_driver/media_softlet/agnostic/Xe_M/Xe_HPM/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_hpm.cpp +++ b/media_driver/media_softlet/agnostic/Xe_M/Xe_HPM/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_hpm.cpp @@ -53,26 +53,26 @@ MOS_STATUS Av1VdencPipelineXe_Hpm::Init(void *settings) ENCODE_CHK_NULL_RETURN(task); Av1BrcInitPkt* brcInitpkt = MOS_New(Av1BrcInitPkt, this, task, m_hwInterface); - RegisterPacket(Av1HucBrcInit, brcInitpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1HucBrcInit, brcInitpkt)); ENCODE_CHK_STATUS_RETURN(brcInitpkt->Init()); Av1BrcUpdatePkt* brcUpdatepkt = MOS_New(Av1BrcUpdatePkt, this, task, m_hwInterface); - RegisterPacket(Av1HucBrcUpdate, brcUpdatepkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1HucBrcUpdate, brcUpdatepkt)); ENCODE_CHK_STATUS_RETURN(brcUpdatepkt->Init()); Av1VdencPktXe_Hpm *av1Vdencpkt = MOS_New(Av1VdencPktXe_Hpm, this, task, m_hwInterface); - RegisterPacket(Av1VdencPacket, av1Vdencpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1VdencPacket, av1Vdencpkt)); ENCODE_CHK_STATUS_RETURN(av1Vdencpkt->Init()); if (m_dualEncEnable) { Av1PakIntegratePkt *av1PakIntPkt = MOS_New(Av1PakIntegratePkt, this, task, m_hwInterface); - RegisterPacket(Av1PakIntegrate, av1PakIntPkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1PakIntegrate, av1PakIntPkt)); ENCODE_CHK_STATUS_RETURN(av1PakIntPkt->Init()); } Av1BackAnnotationPkt *av1BackAnnotationpkt = MOS_New(Av1BackAnnotationPkt, this, task, m_hwInterface); - RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt)); ENCODE_CHK_STATUS_RETURN(av1BackAnnotationpkt->Init()); return MOS_STATUS_SUCCESS; diff --git a/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_m_base.cpp b/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_m_base.cpp index 33411ccab21..0094f82f822 100644 --- a/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_m_base.cpp +++ b/media_driver/media_softlet/agnostic/Xe_M/Xe_M_base/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_m_base.cpp @@ -51,19 +51,19 @@ MOS_STATUS Av1VdencPipelineXe_M_Base::Init(void *settings) ENCODE_CHK_NULL_RETURN(task); Av1BrcInitPkt* brcInitpkt = MOS_New(Av1BrcInitPkt, this, task, m_hwInterface); - RegisterPacket(Av1HucBrcInit, brcInitpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1HucBrcInit, brcInitpkt)); ENCODE_CHK_STATUS_RETURN(brcInitpkt->Init()); Av1BrcUpdatePkt* brcUpdatepkt = MOS_New(Av1BrcUpdatePkt, this, task, m_hwInterface); - RegisterPacket(Av1HucBrcUpdate, brcUpdatepkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1HucBrcUpdate, brcUpdatepkt)); ENCODE_CHK_STATUS_RETURN(brcUpdatepkt->Init()); Av1VdencPktXe_M_Base *av1Vdencpkt = MOS_New(Av1VdencPktXe_M_Base, this, task, m_hwInterface); - RegisterPacket(Av1VdencPacket, av1Vdencpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1VdencPacket, av1Vdencpkt)); ENCODE_CHK_STATUS_RETURN(av1Vdencpkt->Init()); Av1BackAnnotationPkt *av1BackAnnotationpkt = MOS_New(Av1BackAnnotationPkt, this, task, m_hwInterface); - RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt)); ENCODE_CHK_STATUS_RETURN(av1BackAnnotationpkt->Init()); return MOS_STATUS_SUCCESS; diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_lpm_plus.cpp b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_lpm_plus.cpp index fe531f3dcc5..c3a61b8442e 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_lpm_plus.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/av1/pipeline/encode_av1_vdenc_pipeline_xe_lpm_plus.cpp @@ -81,18 +81,18 @@ MOS_STATUS Av1VdencPipelineXe_LPM_Plus::Init(void *settings) #else auto av1Vdencpkt = MOS_New(Av1VdencPktXe_Lpm_Plus, this, task, m_hwInterface); #endif // !(_MEDIA_RESERVED) - RegisterPacket(Av1VdencPacket, av1Vdencpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1VdencPacket, av1Vdencpkt)); ENCODE_CHK_STATUS_RETURN(av1Vdencpkt->Init()); if (m_dualEncEnable) { Av1PakIntegratePkt* av1PakIntPkt = MOS_New(Av1PakIntegratePkt, this, task, m_hwInterface); - RegisterPacket(Av1PakIntegrate, av1PakIntPkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1PakIntegrate, av1PakIntPkt)); ENCODE_CHK_STATUS_RETURN(av1PakIntPkt->Init()); } auto av1BackAnnotationpkt = MOS_New(Av1BackAnnotationPkt, this, task, m_hwInterface); - RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt); + ENCODE_CHK_STATUS_RETURN(RegisterPacket(Av1BackAnnotation, av1BackAnnotationpkt)); ENCODE_CHK_STATUS_RETURN(av1BackAnnotationpkt->Init()); m_sfcItf = m_hwInterface->GetMediaSfcInterface(); diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus.cpp b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus.cpp index 821bb755cf7..1916f1479d3 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus.cpp @@ -55,37 +55,37 @@ MOS_STATUS Vp9VdencPipelineXe_Lpm_Plus::Init(void *settings) Vp9HucBrcInitPkt *brcInitPkt = MOS_New(Vp9HucBrcInitPkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(brcInitPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(HucBrcInit, brcInitPkt)); - brcInitPkt->Init(); + ENCODE_CHK_STATUS_RETURN(brcInitPkt->Init()); Vp9HucBrcUpdatePkt *brcUpdatePkt = MOS_New(Vp9HucBrcUpdatePkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(brcUpdatePkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(HucBrcUpdate, brcUpdatePkt)); - brcUpdatePkt->Init(); + ENCODE_CHK_STATUS_RETURN(brcUpdatePkt->Init()) Vp9HpuPkt *hucProbPkt = MOS_New(Vp9HpuPkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(hucProbPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9HucProb, hucProbPkt)); - hucProbPkt->Init(); + ENCODE_CHK_STATUS_RETURN(hucProbPkt->Init()); Vp9HpuSuperFramePkt *hucSuperFramePkt = MOS_New(Vp9HpuSuperFramePkt, task, hucProbPkt); ENCODE_CHK_NULL_RETURN(hucSuperFramePkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9HucSuperFrame, hucSuperFramePkt)); - hucSuperFramePkt->Init(); + ENCODE_CHK_STATUS_RETURN(hucSuperFramePkt->Init()); Vp9DynamicScalPktXe_Lpm_Plus *vp9DynamicScalPkt = MOS_New(Vp9DynamicScalPktXe_Lpm_Plus, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(vp9DynamicScalPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9DynamicScal, vp9DynamicScalPkt)); - vp9DynamicScalPkt->Init(); + ENCODE_CHK_STATUS_RETURN(vp9DynamicScalPkt->Init()); Vp9VdencPktXe_Lpm_Plus *vp9VdencPkt = MOS_New(Vp9VdencPktXe_Lpm_Plus, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(vp9VdencPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9VdencPacket, vp9VdencPkt)); - vp9VdencPkt->Init(); + ENCODE_CHK_STATUS_RETURN(vp9VdencPkt->Init()); Vp9PakIntegratePktXe_Lpm_Plus *pakIntPkt = MOS_New(Vp9PakIntegratePktXe_Lpm_Plus, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(pakIntPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9PakIntegrate, pakIntPkt)); - pakIntPkt->Init(); + ENCODE_CHK_STATUS_RETURN(pakIntPkt->Init()); return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus_base.cpp b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus_base.cpp index c600eb59c83..664d20f4219 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus_base.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/enc/vp9/pipeline/encode_vp9_vdenc_pipeline_xe_lpm_plus_base.cpp @@ -60,37 +60,37 @@ MOS_STATUS Vp9VdencPipelineXe_Lpm_Plus_Base::Init(void *settings) Vp9HucBrcInitPkt *brcInitPkt = MOS_New(Vp9HucBrcInitPkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(brcInitPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(HucBrcInit, brcInitPkt)); - brcInitPkt->Init(); + ENCODE_CHK_STATUS_RETURN(brcInitPkt->Init()); Vp9HucBrcUpdatePkt *brcUpdatePkt = MOS_New(Vp9HucBrcUpdatePkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(brcUpdatePkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(HucBrcUpdate, brcUpdatePkt)); - brcUpdatePkt->Init(); + ENCODE_CHK_STATUS_RETURN(brcUpdatePkt->Init()); Vp9HpuPkt *hucProbPkt = MOS_New(Vp9HpuPkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(hucProbPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9HucProb, hucProbPkt)); - hucProbPkt->Init(); + ENCODE_CHK_STATUS_RETURN(hucProbPkt->Init()); Vp9HpuSuperFramePkt *hucSuperFramePkt = MOS_New(Vp9HpuSuperFramePkt, task, hucProbPkt); ENCODE_CHK_NULL_RETURN(hucSuperFramePkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9HucSuperFrame, hucSuperFramePkt)); - hucSuperFramePkt->Init(); + ENCODE_CHK_STATUS_RETURN(hucSuperFramePkt->Init()); Vp9DynamicScalPktXe_Lpm_Plus_Base *vp9DynamicScalPkt = MOS_New(Vp9DynamicScalPktXe_Lpm_Plus_Base, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(vp9DynamicScalPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9DynamicScal, vp9DynamicScalPkt)); - vp9DynamicScalPkt->Init(); + ENCODE_CHK_STATUS_RETURN(vp9DynamicScalPkt->Init()); Vp9VdencPktXe_Lpm_Plus_Base *vp9VdencPkt = MOS_New(Vp9VdencPktXe_Lpm_Plus_Base, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(vp9VdencPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9VdencPacket, vp9VdencPkt)); - vp9VdencPkt->Init(); + ENCODE_CHK_STATUS_RETURN(vp9VdencPkt->Init()); Vp9PakIntegratePkt *pakIntPkt = MOS_New(Vp9PakIntegratePkt, this, task, m_hwInterface); ENCODE_CHK_NULL_RETURN(pakIntPkt); ENCODE_CHK_STATUS_RETURN(RegisterPacket(Vp9PakIntegrate, pakIntPkt)); - pakIntPkt->Init(); + ENCODE_CHK_STATUS_RETURN(pakIntPkt->Init()); return MOS_STATUS_SUCCESS; }