Skip to content

Commit

Permalink
Texture: Align to 32 byte - we might end up in ffmpeg buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch committed Oct 29, 2016
1 parent 855f068 commit 33713e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xbmc/guilib/FFmpegImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bool CFFmpegImage::DecodeFrame(AVFrame* frame, unsigned int width, unsigned int

bool needsCopy = false;
int pixelsSize = pitch * height;
bool aligned = (((uintptr_t)(const void *)(pixels)) % (16) == 0);
bool aligned = (((uintptr_t)(const void *)(pixels)) % (32) == 0);
if (!aligned)
CLog::Log(LOGDEBUG, "Alignment of external buffer is not suitable for ffmpeg intrinsics - please fix your malloc");

Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned in
if (GetPitch() * GetRows() > 0)
{
size_t size = GetPitch() * GetRows();
m_pixels = (unsigned char*) _aligned_malloc(size, 16);
m_pixels = (unsigned char*) _aligned_malloc(size, 32);

if (m_pixels == nullptr)
{
Expand Down

0 comments on commit 33713e0

Please sign in to comment.