mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-28 19:12:39 +00:00
53 lines
1.7 KiB
Diff
53 lines
1.7 KiB
Diff
From 39539edc19d65a5f237e455a1ce83c97e39e40b7 Mon Sep 17 00:00:00 2001
|
|
From: Ilies CHERGUI <ichergui@nvidia.com>
|
|
Date: Fri, 17 Nov 2023 12:59:14 +0000
|
|
Subject: [PATCH 6/7] Fix resource leak in nvv4l2decoder
|
|
|
|
See: https://forums.developer.nvidia.com/t/175198/11
|
|
|
|
Upstream-Status: Pending
|
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
|
Signed-off-by: Ilies CHERGUI <ilies.chergui@gmail.com>
|
|
---
|
|
gstv4l2object.c | 7 +++++++
|
|
gstv4l2videodec.c | 4 +++-
|
|
2 files changed, 10 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/gstv4l2object.c b/gstv4l2object.c
|
|
index bf42f15..dd98510 100644
|
|
--- a/gstv4l2object.c
|
|
+++ b/gstv4l2object.c
|
|
@@ -3802,6 +3802,13 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
|
|
(v4l2object->open_mjpeg_block == TRUE) &&
|
|
(g_str_equal(gst_structure_get_name(gst_caps_get_structure (caps, 0)), "image/jpeg")))
|
|
format.fmt.pix_mp.pixelformat = pixelformat = V4L2_PIX_FMT_MJPEG;
|
|
+ else if ((!strcmp (v4l2object->videodev, V4L2_DEVICE_PATH_NVDEC)) &&
|
|
+ V4L2_TYPE_IS_OUTPUT (v4l2object->type) &&
|
|
+ (width == 0 || height == 0)) {
|
|
+ GST_WARNING_OBJECT (v4l2object->dbg_obj,
|
|
+ "Invalid caps: %s", gst_caps_to_string(caps));
|
|
+ goto invalid_caps;
|
|
+ }
|
|
#endif
|
|
|
|
#ifdef USE_V4L2_TARGET_NV
|
|
diff --git a/gstv4l2videodec.c b/gstv4l2videodec.c
|
|
index aa0ef4f..2b80a38 100644
|
|
--- a/gstv4l2videodec.c
|
|
+++ b/gstv4l2videodec.c
|
|
@@ -891,8 +891,10 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
|
|
|
|
if (ret)
|
|
self->input_state = gst_video_codec_state_ref (state);
|
|
- else
|
|
+ else {
|
|
gst_v4l2_error (self, &error);
|
|
+ return FALSE;
|
|
+ }
|
|
|
|
#ifdef USE_V4L2_TARGET_NV
|
|
ret = set_v4l2_controls(self);
|
|
--
|
|
2.25.1
|
|
|