diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 84bb74ad28..1159dfa41f 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -1303,11 +1303,7 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptrdata[0], frame->data[1], frame->data[2], alpha_plane.get() }; int in_line[4] = { frame->linesize[0], frame->linesize[1], frame->linesize[2], w * 1 }; u8* out_data[4] = { outBuff.get_ptr() }; - int out_line[4] = { w * 4 }; // RGBA32 or ARGB32 - - // TODO: - // It's possible that we need to align the pitch to 128 here. - // PS HOME seems to rely on this somehow in certain cases. + int out_line[4] = { static_cast(utils::align(w * 4, 128)) }; // RGBA32 or ARGB32 if (!alpha_plane) { @@ -1319,6 +1315,10 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptrsws, in_data, in_line, 0, h, out_data, out_line); @@ -1429,9 +1429,10 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptrcodecType = vdec->type; info->startAddr = 0x00000123; // invalid value (no address for picture) - const int buffer_size = av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1); + const int buffer_size = av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 128); ensure(buffer_size >= 0); - info->size = utils::align(buffer_size, 128); + ensure(buffer_size % 128 == 0); + info->size = static_cast(buffer_size); info->auNum = 1; info->auPts[0].lower = static_cast(pts); info->auPts[0].upper = static_cast(pts >> 32);