From 7627ff0265d3a533c354612cdb1a46ab6f1c4d44 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Thu, 30 Jan 2020 09:38:36 +0900 Subject: [PATCH] Remove unreachable code - Fix svace WGID 425086 Varaible 'pForamtCtx' can't be null because of 'NULL == formatContext->privateFormatData' checker. Change-Id: I6e18ffad655bb3de10a8379257e65d473226dbb3 --- formats/ffmpeg/mm_file_format_ffmpeg.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/formats/ffmpeg/mm_file_format_ffmpeg.c b/formats/ffmpeg/mm_file_format_ffmpeg.c index 74479c9..75552f0 100644 --- a/formats/ffmpeg/mm_file_format_ffmpeg.c +++ b/formats/ffmpeg/mm_file_format_ffmpeg.c @@ -699,18 +699,13 @@ EXPORT_API int mmfile_format_read_tag_ffmpg(MMFileFormatContext *formatContext) { AVFormatContext *pFormatCtx = NULL; + unsigned int idx = 0; - if (NULL == formatContext || NULL == formatContext->privateFormatData) { + if (!formatContext || !formatContext->privateFormatData) { debug_error(DEBUG, "invalid param\n"); return MMFILE_FORMAT_FAIL; } - pFormatCtx = formatContext->privateFormatData; - if (!pFormatCtx) { - debug_warning(DEBUG, "No format information"); - return MMFILE_FORMAT_SUCCESS; - } - if (formatContext->formatType == MM_FILE_FORMAT_3GP || formatContext->formatType == MM_FILE_FORMAT_MP4) { MMFileUtilGetMetaDataFromMP4(formatContext); } @@ -719,9 +714,9 @@ int mmfile_format_read_tag_ffmpg(MMFileFormatContext *formatContext) MMFileUtilGetMetaDataFromMKV(formatContext); } - /*metadata extracted by ffmpeg*/ - unsigned int idx = 0; + pFormatCtx = formatContext->privateFormatData; + /*metadata extracted by ffmpeg*/ for (idx = 0; idx < pFormatCtx->nb_streams + 1; idx++) { AVDictionary *metainfo = NULL; AVStream *st = NULL; -- 2.7.4