fix(*): address nullptr deref and resource leaks

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
k4yt3x
2026-03-07 00:00:00 +00:00
parent 4a8669b0b3
commit 7db9c18d62
8 changed files with 30 additions and 3 deletions

View File

@@ -184,6 +184,10 @@ int FilterRealcugan::filter(AVFrame* in_frame, AVFrame** out_frame) {
// Convert ncnn::Mat to AVFrame
*out_frame = conversions::ncnn_mat_to_avframe(out_mat, out_pix_fmt_);
if (*out_frame == nullptr) {
logger()->error("Failed to convert ncnn::Mat to AVFrame");
return AVERROR(ENOMEM);
}
// Rescale PTS to encoder's time base
(*out_frame)->pts = av_rescale_q(in_frame->pts, in_time_base_, out_time_base_);