mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 09:32:42 +00:00
cellVdecGetPicture accurate error checking
This commit is contained in:
parent
0044eb44e2
commit
f4fb5200a0
@ -1,4 +1,4 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
#include "Emu/IdManager.h"
|
#include "Emu/IdManager.h"
|
||||||
#include "Emu/Cell/PPUModule.h"
|
#include "Emu/Cell/PPUModule.h"
|
||||||
@ -551,7 +551,7 @@ s32 cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm::ptr<u
|
|||||||
|
|
||||||
const auto vdec = idm::get<vdec_context>(handle);
|
const auto vdec = idm::get<vdec_context>(handle);
|
||||||
|
|
||||||
if (!format || !vdec)
|
if (!format || !vdec || format->formatType > 4 || (format->formatType <= CELL_VDEC_PICFMT_RGBA32_ILV && format->colorMatrixType > CELL_VDEC_COLOR_MATRIX_TYPE_BT709))
|
||||||
{
|
{
|
||||||
return CELL_VDEC_ERROR_ARG;
|
return CELL_VDEC_ERROR_ARG;
|
||||||
}
|
}
|
||||||
@ -599,10 +599,6 @@ s32 cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm::ptr<u
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: color matrix
|
// TODO: color matrix
|
||||||
if (format->colorMatrixType & ~1)
|
|
||||||
{
|
|
||||||
fmt::throw_exception("Unknown colorMatrixType (%d)" HERE, format->colorMatrixType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alpha_plane)
|
if (alpha_plane)
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ enum CellVdecDecodeMode : s32
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Output Picture Format Type
|
// Output Picture Format Type
|
||||||
enum CellVdecPicFormatType : s32
|
enum CellVdecPicFormatType : u32
|
||||||
{
|
{
|
||||||
CELL_VDEC_PICFMT_ARGB32_ILV,
|
CELL_VDEC_PICFMT_ARGB32_ILV,
|
||||||
CELL_VDEC_PICFMT_RGBA32_ILV,
|
CELL_VDEC_PICFMT_RGBA32_ILV,
|
||||||
@ -48,7 +48,7 @@ enum CellVdecPicFormatType : s32
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Output Color Matrix Coef
|
// Output Color Matrix Coef
|
||||||
enum CellVdecColorMatrixType : s32
|
enum CellVdecColorMatrixType : u32
|
||||||
{
|
{
|
||||||
CELL_VDEC_COLOR_MATRIX_TYPE_BT601,
|
CELL_VDEC_COLOR_MATRIX_TYPE_BT601,
|
||||||
CELL_VDEC_COLOR_MATRIX_TYPE_BT709,
|
CELL_VDEC_COLOR_MATRIX_TYPE_BT709,
|
||||||
@ -157,15 +157,15 @@ struct CellVdecPicItem
|
|||||||
// Output Picture Format
|
// Output Picture Format
|
||||||
struct CellVdecPicFormat
|
struct CellVdecPicFormat
|
||||||
{
|
{
|
||||||
be_t<s32> formatType; // CellVdecPicFormatType
|
be_t<u32> formatType; // CellVdecPicFormatType
|
||||||
be_t<s32> colorMatrixType; // CellVdecColorMatrixType
|
be_t<u32> colorMatrixType; // CellVdecColorMatrixType
|
||||||
u8 alpha;
|
u8 alpha;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellVdecPicFormat2
|
struct CellVdecPicFormat2
|
||||||
{
|
{
|
||||||
be_t<s32> formatType; // CellVdecPicFormatType
|
be_t<u32> formatType; // CellVdecPicFormatType
|
||||||
be_t<s32> colorMatrixType; // CellVdecColorMatrixType
|
be_t<u32> colorMatrixType; // CellVdecColorMatrixType
|
||||||
be_t<u32> unk0;
|
be_t<u32> unk0;
|
||||||
u8 alpha;
|
u8 alpha;
|
||||||
be_t<u32> unk1;
|
be_t<u32> unk1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user