From: jiyong.min Date: Wed, 10 Jun 2020 03:05:48 +0000 (+0900) Subject: add to typecasting 'File' because crash occur for TC X-Git-Tag: submit/tizen/20200611.013522~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bed26671a8a59d9133241192e6414b99e4318f20;p=platform%2Fcore%2Fapi%2Fmetadata-editor.git add to typecasting 'File' because crash occur for TC - Using 'delete _metadata->file' make crash. Change-Id: Id1d3a318ebdc270d0ae976acc0e6043748104384 --- diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index 6dbe835..24b8d64 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -1505,8 +1505,31 @@ extern "C" int metadata_editor_destroy(metadata_editor_h metadata) metadata_editor_retvm_if(!_metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata"); - if (_metadata->file) - delete _metadata->file; + switch (_metadata->filetype) { + case METADATA_EDITOR_FORMAT_MP3: + delete dynamic_cast(_metadata->file); + break; + case METADATA_EDITOR_FORMAT_MP4: + delete dynamic_cast(_metadata->file); + break; +#if 0 + case METADATA_EDITOR_FORMAT_FLAC: + delete dynamic_cast(_metadata->file); + break; + case METADATA_EDITOR_FORMAT_OGG_VORBIS: + delete dynamic_cast(_metadata->file); + break; + case METADATA_EDITOR_FORMAT_OGG_FLAC: + delete dynamic_cast(_metadata->file); + break; + case METADATA_EDITOR_FORMAT_WAV: + delete dynamic_cast(_metadata->file); + break; +#endif + default: + metadata_editor_error("Wrong file type"); + return METADATA_EDITOR_ERROR_INVALID_PARAMETER; + } g_free(_metadata);