From 4ac464bef3dc8374be8ec456b7a01cdfbf2a93fb Mon Sep 17 00:00:00 2001 From: Kwanghoon Son Date: Wed, 22 Mar 2023 14:01:59 +0900 Subject: Fix format unref and media packet test [Issue type] fix [Version] 0.27.9 Change-Id: Ifa13a2d3745d554c795f5659bc58a30c695917bf Signed-off-by: Kwanghoon Son --- mv_common/src/mv_common_c.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mv_common') diff --git a/mv_common/src/mv_common_c.cpp b/mv_common/src/mv_common_c.cpp index 67ac10e9..ef359a07 100644 --- a/mv_common/src/mv_common_c.cpp +++ b/mv_common/src/mv_common_c.cpp @@ -109,9 +109,17 @@ int mv_source_fill_by_media_packet_c(mv_source_h source, media_packet_h media_pa ret = media_format_get_video_info(format, &mimetype, &image_width, &image_height, NULL, NULL); if (ret != MEDIA_PACKET_ERROR_NONE) { + if (media_format_unref(format) != MEDIA_PACKET_ERROR_NONE) + LOGE("media_format_unref() failed, mv_source_h fill skipped"); + LOGE("media_format_get_video_info() failed, mv_source_h fill skipped"); return MEDIA_VISION_ERROR_INVALID_PARAMETER; } + ret = media_format_unref(format); + if (ret != MEDIA_PACKET_ERROR_NONE) { + LOGE("media_format_unref() failed, mv_source_h fill skipped"); + return MEDIA_VISION_ERROR_INVALID_PARAMETER; + } if (mimetype > MEDIA_FORMAT_H261 && mimetype <= MEDIA_FORMAT_MPEG4_ASP) { LOGE("Media format mimetype is not the raw video, mv_source_h fill skipped"); -- cgit v1.2.3