audio_decoder: check for failed av_packet_alloc

This commit is contained in:
Megamouse 2024-01-08 21:17:06 +01:00
parent 7aad4f4253
commit 45c89030ac

View file

@ -545,6 +545,13 @@ namespace utils
}
AVPacket* packet = av_packet_alloc();
if (!packet)
{
media_log.error("audio_decoder: Error allocating the packet");
has_error = true;
return;
}
std::unique_ptr<AVPacket, decltype([](AVPacket* p){av_packet_unref(p);})> packet_(packet);
// Iterate through frames