mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-04-10 03:37:31 +08:00
fix(*): address nullptr deref and resource leaks
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user