Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
Error in offset calculation for YUY2 is fixed
Browse files Browse the repository at this point in the history
Change-Id: I637010ff1856fa6550b64ac829a1aa55ceb09192
  • Loading branch information
fzhar committed Nov 12, 2018
1 parent 9f0aa3a commit ebab829
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/sample_common/src/sample_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ mfxStatus CSmplYUVReader::LoadNextFrame(mfxFrameSurface1* pSurface)
break;
case MFX_FOURCC_YUY2:
pitch = pData.Pitch;
ptr = pData.Y + pInfo.CropX + pInfo.CropY * pData.Pitch;
ptr = pData.Y + pInfo.CropX*2 + pInfo.CropY * pData.Pitch;

for(i = 0; i < h; i++)
{
nBytesRead = (mfxU32)fread(ptr + i * pitch, 1, 2*w, m_files[vid]);
nBytesRead = (mfxU32)fread(ptr + i * pitch, 2, w, m_files[vid]);

if ((mfxU32)2*w != nBytesRead)
if ((mfxU32)w != nBytesRead)
{
return MFX_ERR_MORE_DATA;
}
Expand Down

0 comments on commit ebab829

Please sign in to comment.