mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-09 08:35:03 -06:00
cellAdec: fix uninitialized default size of AVPacketHolder (#12077)
This commit is contained in:
parent
961d41d0bd
commit
88ee62be26
@ -456,19 +456,19 @@ public:
|
|||||||
|
|
||||||
struct AVPacketHolder : AVPacket
|
struct AVPacketHolder : AVPacket
|
||||||
{
|
{
|
||||||
AVPacketHolder(u32 size)
|
AVPacketHolder(u32 data_size)
|
||||||
{
|
{
|
||||||
av_init_packet(this);
|
av_init_packet(this);
|
||||||
|
|
||||||
if (size)
|
if (data_size)
|
||||||
{
|
{
|
||||||
data = static_cast<u8*>(av_calloc(1, size + AV_INPUT_BUFFER_PADDING_SIZE));
|
this->data = static_cast<u8*>(av_calloc(1, data_size + AV_INPUT_BUFFER_PADDING_SIZE));
|
||||||
this->size = size + AV_INPUT_BUFFER_PADDING_SIZE;
|
this->size = data_size + AV_INPUT_BUFFER_PADDING_SIZE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = nullptr;
|
this->data = nullptr;
|
||||||
size = 0;
|
this->size = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -324,8 +324,6 @@ namespace utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prepare to read data
|
// Prepare to read data
|
||||||
AVPacket packet;
|
|
||||||
av_init_packet(&packet);
|
|
||||||
av.frame = av_frame_alloc();
|
av.frame = av_frame_alloc();
|
||||||
if (!av.frame)
|
if (!av.frame)
|
||||||
{
|
{
|
||||||
@ -335,6 +333,9 @@ namespace utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
duration_ms = stream->duration / 1000;
|
duration_ms = stream->duration / 1000;
|
||||||
|
|
||||||
|
AVPacket packet{};
|
||||||
|
av_init_packet(&packet);
|
||||||
|
|
||||||
// Iterate through frames
|
// Iterate through frames
|
||||||
while (thread_ctrl::state() != thread_state::aborting && av_read_frame(av.format, &packet) >= 0)
|
while (thread_ctrl::state() != thread_state::aborting && av_read_frame(av.format, &packet) >= 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user