1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

cellVdecDecodeAu: add codec type check

This commit is contained in:
Megamouse 2022-04-12 19:54:07 +02:00
parent fb3752a8ef
commit ee3a302cf2
2 changed files with 8 additions and 7 deletions

View File

@ -1023,17 +1023,17 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd
}
}
if (mode < 0 || mode > CELL_VDEC_DEC_MODE_PB_SKIP)
if (mode < 0 || mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP))
{
return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d", +mode) };
}
// TODO:
//if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && something != 3) ||
// (mode == CELL_VDEC_DEC_MODE_PB_SKIP && something != 1))
//{
// return CELL_VDEC_ERROR_ARG;
//}
// TODO: what does the 3 stand for ?
if ((mode == CELL_VDEC_CODEC_TYPE_MAX && vdec->type != 3) ||
(mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC))
{
return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d, type=%d", +mode, vdec->type) };
}
if (!vdec->au_count.try_inc(4))
{

View File

@ -17,6 +17,7 @@ enum CellVdecCodecType : s32
CELL_VDEC_CODEC_TYPE_MPEG2 = 0,
CELL_VDEC_CODEC_TYPE_AVC = 1,
CELL_VDEC_CODEC_TYPE_DIVX = 5,
CELL_VDEC_CODEC_TYPE_MAX
};
// Callback Messages