Skip to content
Permalink
Browse files

Rasterizer: Fix x64 crash, pointer truncated to 32 bit

  • Loading branch information...
pinterf committed Sep 4, 2018
1 parent 569cc5a commit a80ecea6f66b4b0ffede17b1982d32806f8c24cf
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/subtitles/Rasterizer.cpp
@@ -1669,8 +1669,8 @@ void AlphaBlt8bppSse2(byte* pY,
{
const BYTE* sa = pAlphaMask;
BYTE* dy = pY;
const BYTE* dy_first_mod16 = reinterpret_cast<BYTE*>((reinterpret_cast<int>(pY)+15)&~15); //IMPORTANT! w must >= 15
const BYTE* dy_end_mod16 = reinterpret_cast<BYTE*>(reinterpret_cast<int>(pY+w)&~15);
const BYTE* dy_first_mod16 = reinterpret_cast<BYTE*>((reinterpret_cast<intptr_t>(pY)+15)&~15); //IMPORTANT! w must >= 15
const BYTE* dy_end_mod16 = reinterpret_cast<BYTE*>(reinterpret_cast<intptr_t>(pY+w)&~15);
const BYTE* dy_end = pY + w;

for(;dy < dy_first_mod16; sa++, dy++)
@@ -1770,8 +1770,8 @@ void AlphaBlt8bppSingleAlphaSse2(byte* pY,
for( ; h>0; h--, pY += dst_stride )
{
BYTE* dy = pY;
const BYTE* dy_first_mod16 = reinterpret_cast<BYTE*>((reinterpret_cast<int>(pY)+15)&~15); //IMPORTANT! w must >= 15
const BYTE* dy_end_mod16 = reinterpret_cast<BYTE*>(reinterpret_cast<int>(pY+w)&~15);
const BYTE* dy_first_mod16 = reinterpret_cast<BYTE*>((reinterpret_cast<intptr_t>(pY)+15)&~15); //IMPORTANT! w must >= 15
const BYTE* dy_end_mod16 = reinterpret_cast<BYTE*>(reinterpret_cast<intptr_t>(pY+w)&~15);
const BYTE* dy_end = pY + w;

for(;dy < dy_first_mod16; dy++)

0 comments on commit a80ecea

Please sign in to comment.
You can’t perform that action at this time.