mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01: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
|
||||
{
|
||||
AVPacketHolder(u32 size)
|
||||
AVPacketHolder(u32 data_size)
|
||||
{
|
||||
av_init_packet(this);
|
||||
|
||||
if (size)
|
||||
if (data_size)
|
||||
{
|
||||
data = static_cast<u8*>(av_calloc(1, size + AV_INPUT_BUFFER_PADDING_SIZE));
|
||||
this->size = size + AV_INPUT_BUFFER_PADDING_SIZE;
|
||||
this->data = static_cast<u8*>(av_calloc(1, data_size + AV_INPUT_BUFFER_PADDING_SIZE));
|
||||
this->size = data_size + AV_INPUT_BUFFER_PADDING_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = nullptr;
|
||||
size = 0;
|
||||
this->data = nullptr;
|
||||
this->size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,8 +324,6 @@ namespace utils
|
||||
}
|
||||
|
||||
// Prepare to read data
|
||||
AVPacket packet;
|
||||
av_init_packet(&packet);
|
||||
av.frame = av_frame_alloc();
|
||||
if (!av.frame)
|
||||
{
|
||||
@ -335,6 +333,9 @@ namespace utils
|
||||
}
|
||||
|
||||
duration_ms = stream->duration / 1000;
|
||||
|
||||
AVPacket packet{};
|
||||
av_init_packet(&packet);
|
||||
|
||||
// Iterate through frames
|
||||
while (thread_ctrl::state() != thread_state::aborting && av_read_frame(av.format, &packet) >= 0)
|
||||
|
Loading…
Reference in New Issue
Block a user