From 1edbd55790471c3b390bd041a639e7f95b34b2f6 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Fri, 12 Feb 2016 08:56:02 +0900 Subject: [PATCH] Add checker for id3tag v1 size and memory overlap issue fix Change-Id: I4005065f31ab41a208ea12bf9949a661b57dccac Signed-off-by: Minje Ahn --- formats/ffmpeg/mm_file_format_mp3.c | 10 ++++++---- packaging/libmm-fileinfo.spec | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/formats/ffmpeg/mm_file_format_mp3.c b/formats/ffmpeg/mm_file_format_mp3.c index 38f1c09..8786c1c 100755 --- a/formats/ffmpeg/mm_file_format_mp3.c +++ b/formats/ffmpeg/mm_file_format_mp3.c @@ -1271,10 +1271,12 @@ static int mmf_file_mp3_get_infomation(char *filename, AvFileContentInfo *pInfo) #endif pInfo->bV1tagFound = true; - /* In this case, V2 Tag alreay exist So, ignore V1 tag */ - if (pInfo->tagV2Info.tagLen == 0) { - memcpy(TagBuff, (TagBuff + tagHeaderPos), MP3TAGINFO_SIZE); - if (!mm_file_id3tag_parse_v110(pInfo, TagBuff)) + /* In this case, V2 Tag not exist.. So, try to read V1 tag */ + if (pInfo->tagV2Info.tagLen == 0 && tagHeaderPos == TAGV1_SEEK_GAP) { + unsigned char TmpBuff[MP3TAGINFO_SIZE] = {0, }; + + memcpy(TmpBuff, (TagBuff + tagHeaderPos), MP3TAGINFO_SIZE); + if (!mm_file_id3tag_parse_v110(pInfo, TmpBuff)) goto EXCEPTION; } } diff --git a/packaging/libmm-fileinfo.spec b/packaging/libmm-fileinfo.spec index 8d5ca3e..2e0c4a1 100755 --- a/packaging/libmm-fileinfo.spec +++ b/packaging/libmm-fileinfo.spec @@ -1,6 +1,6 @@ Name: libmm-fileinfo Summary: Media Fileinfo -Version: 0.6.42 +Version: 0.6.43 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4