fix: unref each packet in FFmpeg_Input::get_frame

The packet guard was commented out, so a packet skipped because it
belongs to another stream (audio in an event video) stayed referenced
when the next av_read_frame() reset it, which leaks it before FFmpeg 7.
avcodec_send_packet() takes its own reference, so unreferencing after
it is safe.

refs #4860

fixes #5371
This commit is contained in:
Nic Boet committed 2026-10-30 16:11:48 -05:00
1 parent bf1dda0dc5
commit a804b2e7a5
1 file changed
+1 -1
+1 -1
View File
@@ -231,7 +231,7 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id) {
}
ZM_DUMP_STREAM_PACKET(input_format_context->streams[packet->stream_index], packet, "Received packet");
//av_packet_guard pkt_guard{packet};
av_packet_guard pkt_guard{packet};
if ((stream_id >= 0) && (packet->stream_index != stream_id)) {
Debug(4, "Packet is not for our stream (%d)", packet->stream_index );