Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3056 Discussions

Bug in MoveMfxBitstream (sample_utils.cpp) v5.0.337.79303

Paul_V_
Beginner
191 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
191 Views

Thanks you!

 

0 Kudos
Reply