formatContext->artworkMime = g_strdup(aacinfo.artworkMime);
if (aacinfo.artwork) {
formatContext->artworkSize = aacinfo.artworkSize;
- formatContext->artwork = g_memdup(aacinfo.artwork, aacinfo.artworkSize);
+ formatContext->artwork = g_memdup2(aacinfo.artwork, aacinfo.artworkSize);
}
#ifdef __MMFILE_TEST_MODE__
current_pos += DATA_LENGTH;
mmfile_free(formatContext->artwork);
- formatContext->artwork = g_memdup(meta_data + current_pos, formatContext->artworkSize);
+ formatContext->artwork = g_memdup2(meta_data + current_pos, formatContext->artworkSize);
g_free(meta_data);
}
mmfile_free(formatContext->artwork);
formatContext->artworkSize = pkt.size;
- formatContext->artwork = g_memdup(pkt.data, pkt.size);
+ formatContext->artwork = g_memdup2(pkt.data, pkt.size);
}
static void __fill_metainfo_in_context(AVDictionary *metainfo, MMFileFormatContext *formatContext)
*pBufLen = 6 * (count + (noteCount - count)) + 56 - 1;
- return g_memdup(midiData, *pBufLen);
+ return g_memdup2(midiData, *pBufLen);
}
static int __get_imelody_tag(const char *uriname, tMMFileImelodyTagInfo *tags)
if (privateData->imageInfo.imageLen > 0) {
formatContext->artworkSize = privateData->imageInfo.imageLen;
- formatContext->artwork = g_memdup(privateData->imageInfo.pImageBuf, privateData->imageInfo.imageLen);
+ formatContext->artwork = g_memdup2(privateData->imageInfo.pImageBuf, privateData->imageInfo.imageLen);
if (strlen(privateData->imageInfo.imageMIMEType) > 0)
formatContext->artworkMime = g_strdup(privateData->imageInfo.imageMIMEType);
mm_attrs_set_string_by_name(attrs, MM_FILE_TAG_UNSYNCLYRICS, formatContext->unsyncLyrics);
if (formatContext->artwork && formatContext->artworkSize > 0) {
- void *artworkCopy = g_memdup(formatContext->artwork, formatContext->artworkSize);
+ void *artworkCopy = g_memdup2(formatContext->artwork, formatContext->artworkSize);
mm_attrs_set_data_by_name(attrs, MM_FILE_TAG_ARTWORK, artworkCopy, formatContext->artworkSize);
mm_attrs_set_int_by_name(attrs, MM_FILE_TAG_ARTWORK_SIZE, formatContext->artworkSize);
if (formatContext->thumbNail && formatContext->thumbNail->frameData) {
void *thumbNailCopy = NULL;
- thumbNailCopy = g_memdup(formatContext->thumbNail->frameData, formatContext->thumbNail->frameSize);
+ thumbNailCopy = g_memdup2(formatContext->thumbNail->frameData, formatContext->thumbNail->frameSize);
mm_attrs_set_data_by_name(attrs, MM_FILE_CONTENT_VIDEO_THUMBNAIL, thumbNailCopy, formatContext->thumbNail->frameSize);
mm_attrs_set_int_by_name(attrs, MM_FILE_CONTENT_VIDEO_WIDTH, formatContext->thumbNail->frameWidth);
Name: libmm-fileinfo
Summary: Media Fileinfo
-Version: 1.0.8
+Version: 1.0.9
Release: 0
Group: System/Libraries
License: Apache-2.0
if (tagInfo.imageInfo.pImageBuf && tagInfo.imageInfo.imageLen > 0) {
formatContext->artworkSize = tagInfo.imageInfo.imageLen;
- formatContext->artwork = g_memdup(tagInfo.imageInfo.pImageBuf, tagInfo.imageInfo.imageLen);
+ formatContext->artwork = g_memdup2(tagInfo.imageInfo.pImageBuf, tagInfo.imageInfo.imageLen);
}
mm_file_free_AvFileContentInfo(&tagInfo);
if (pTagVal[offset + idx] == 0x00) {
synclyrics_info = g_new0(AvSynclyricsInfo, 1);
if (textEncodingType == AV_ID3V2_UTF8)
- synclyrics_info->lyric_info = g_memdup(pTagVal + copy_start_pos, copy_len + 1);
+ synclyrics_info->lyric_info = g_memdup2(pTagVal + copy_start_pos, copy_len + 1);
else
synclyrics_info->lyric_info = mmfile_convert_to_utf8((const char *)&pTagVal[copy_start_pos], copy_len, pCharSet);
tag_len = idx + 1; /* length of description + '\0' */
- tmp_desc = g_memdup(pTagVal + *offset, tag_len);
+ tmp_desc = g_memdup2(pTagVal + *offset, tag_len);
/* convert description */
pInfo->imageInfo.imageDescription = mmfile_convert_to_utf8(tmp_desc, tag_len, pCharSet);
}
pInfo->imageInfo.imageLen = nTagLen - *offset;
- pInfo->imageInfo.pImageBuf = g_memdup(pTagVal + *offset, pInfo->imageInfo.imageLen);
+ pInfo->imageInfo.pImageBuf = g_memdup2(pTagVal + *offset, pInfo->imageInfo.imageLen);
/* if mimetype is "-->", image date has an URL */
if (IS_INCLUDE_URL(pInfo->imageInfo.imageMIMEType))