Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2935 Discussions

Bug in MoveMfxBitstream (sample_utils.cpp) v5.0.337.79303

Paul_V_
Beginner
93 Views

Version: 5.0.337.79303
Project: sample_common
File: sample_utils.cpp
Function: MoveMfxBitstream

The function is supposed to move data from one mfxBitstream to another under the condition that there is enough free space (MaxLength - DataLength) in the target to take all of the remaining data (DataLength) of the source.

While the function does check if the free space of the target is large enough, it does not take into account that the target might NOT be empty when actually copying the data from source to target.

// Line: 555
// wrong
MSDK_MEMCPY_BITSTREAM(*pTarget, pTarget->DataOffset, pSrc->Data + pSrc->DataOffset, nBytes);

// correct
MSDK_MEMCPY_BITSTREAM(*pTarget, pTarget->DataOffset + pTarget->DataLength, pSrc->Data + pSrc->DataOffset, nBytes);

 

0 Kudos
1 Reply
Anthony_P_Intel
Employee
93 Views

Thanks you!

 

Reply