mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-11 18:50:55 +00:00
Merge pull request #242 from unknownbrackets/pngdec
cellPngDec: Ignore bytesPerLine < width * bpp
This commit is contained in:
commit
be11bd85f6
1 changed files with 2 additions and 2 deletions
|
@ -182,7 +182,7 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||||
{
|
{
|
||||||
const char nComponents = current_outParam.outputColorSpace == CELL_PNGDEC_RGBA ? 4 : 3;
|
const char nComponents = current_outParam.outputColorSpace == CELL_PNGDEC_RGBA ? 4 : 3;
|
||||||
image_size *= nComponents;
|
image_size *= nComponents;
|
||||||
if (bytesPerLine != width * nComponents || flip) //check if we need padding
|
if (bytesPerLine > width * nComponents || flip) //check if we need padding
|
||||||
{
|
{
|
||||||
const int linesize = std::min(bytesPerLine, width * nComponents);
|
const int linesize = std::min(bytesPerLine, width * nComponents);
|
||||||
for (int i = 0; i < height; i++)
|
for (int i = 0; i < height; i++)
|
||||||
|
@ -203,7 +203,7 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||||
{
|
{
|
||||||
const char nComponents = 4;
|
const char nComponents = 4;
|
||||||
image_size *= nComponents;
|
image_size *= nComponents;
|
||||||
if (bytesPerLine != width * nComponents || flip) //check if we need padding
|
if (bytesPerLine > width * nComponents || flip) //check if we need padding
|
||||||
{
|
{
|
||||||
//TODO: find out if we can't do padding without an extra copy
|
//TODO: find out if we can't do padding without an extra copy
|
||||||
const int linesize = std::min(bytesPerLine, width * nComponents);
|
const int linesize = std::min(bytesPerLine, width * nComponents);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue