[1.2.4] Fix svace issue(DEREF_OF_NULL.RET.STAT) 56/317656/1 accepted/tizen_unified_dev accepted/tizen/unified/20240919.163729 accepted/tizen/unified/dev/20240920.060418 accepted/tizen/unified/x/20240920.053142
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 13 Sep 2024 02:08:13 +0000 (11:08 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 13 Sep 2024 02:08:17 +0000 (11:08 +0900)
- Added a check if the returned bin object is null.
  If it is null, we throw a MediaTransporterException
  with an appropriate error message and error code.

Change-Id: I825c37a4ff6a0eb1d652e4e2fc059ab453ae34fd

packaging/capi-media-transporter.spec
src/MediaSourceBinMediaPacket.cpp

index 4c1d738d4fce3d73460409477977c92185c018cd..5b664728c7f3a263aacbcac0011b7c6d154689d4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.2.3
+Version:    1.2.4
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index c6ad9b101a1aca9c1503325c775c4320b2efbd90..75f6f8ddc01d0e4a03b62f1f70d6845ebcf031be 100644 (file)
@@ -119,6 +119,8 @@ MediaSourceBinInfo MediaSourceBinMediaPacket::generate()
        }
 
        GstBin* bin = GST_BIN(gst_bin_new(nullptr));
+       if (!bin)
+               throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION, "Failed to create media packet source bin");
 
        try {
                gst::_addElementsToBin(bin, elements);