Skip to content

CAGif加载gif图片后释放时崩溃bug #118

@zentelfong

Description

@zentelfong
            GifWord copyWidth = prev->ImageDesc.Width;
            if (prev->ImageDesc.Left + copyWidth > m_uPixelsWide)
            {
                copyWidth = m_uPixelsWide - prev->ImageDesc.Left;
            }

            GifWord copyHeight = prev->ImageDesc.Height;
            if (prev->ImageDesc.Top + copyHeight > m_uPixelsHigh)
            {
                copyHeight = m_uPixelsHigh - prev->ImageDesc.Top;
            }

            for (; copyHeight > 0; copyHeight--)
            {
                for(int wIndex = 0; wIndex < m_uPixelsWide; wIndex++, dst+=4)
                {
                    *dst     = paintingColor.r;
                    *(dst+1) = paintingColor.g;
                    *(dst+2) = paintingColor.b;
                    *(dst+3) = paintingColor.a;
                }
            }

上面代码中的
for(int wIndex = 0; wIndex < m_uPixelsWide; wIndex++, dst+=4)
应改为
for(int wIndex = 0; wIndex < copyWidth; wIndex++, dst+=4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions