Skip to content

Commit

Permalink
[c2][coverity] Fix coverity issue CID 349680
Browse files Browse the repository at this point in the history
std::make_shared will throw the std::bad_alloc exception rather than return nullptr.
Here just remove the logically dead code for the coverity issue.

Tracked-On: OAM-123225
Signed-off-by: Wan, Hao <[email protected]>
  • Loading branch information
harvan authored and sysopenci committed Oct 8, 2024
1 parent 656fff2 commit a2321db
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion c2_utils/src/mfx_frame_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ mfxStatus MfxC2AVCFrameConstructor::FindHeaders(const mfxU8* data, mfxU32 size,
start_code = ReadStartCode(&data, &size);
if (isSPS(start_code.type)) {
std::shared_ptr<mfxBitstream> sps = std::make_shared<mfxBitstream>();
if (!sps) return MFX_ERR_MEMORY_ALLOC;

MFX_ZERO_MEMORY((*sps));
sps->Data = (mfxU8*)data - start_code.size;
Expand Down

0 comments on commit a2321db

Please sign in to comment.