Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-stagefright-plugins: Commit

external/stagefright-plugins


Commit MetaInfo

Revision76b8e2cb17cafbf4dedd14ab03ec96551f32dd46 (tree)
Time2018-04-29 13:14:24
AuthorMichael Goffioul <michael.goffioul@gmai...>
CommiterChih-Wei Huang

Log Message

omx: fix another memory leak

The 'strdup' call in createSoftOMXComponent() is never freed.

Change Summary

Incremental Difference

--- a/omx/SoftFFmpegAudio.cpp
+++ b/omx/SoftFFmpegAudio.cpp
@@ -1576,12 +1576,12 @@ SoftOMXComponent* SoftFFmpegAudio::createSoftOMXComponent(
15761576 const char *name, const OMX_CALLBACKTYPE *callbacks,
15771577 OMX_PTR appData, OMX_COMPONENTTYPE **component) {
15781578 OMX_AUDIO_CODINGTYPE codingType = OMX_AUDIO_CodingAutoDetect;
1579- char *componentRole = NULL;
1579+ const char *componentRole = NULL;
15801580 enum AVCodecID codecID = AV_CODEC_ID_NONE;
15811581
15821582 for (size_t i = 0; i < kNumAudioComponents; ++i) {
15831583 if (!strcasecmp(name, kAudioComponents[i].mName)) {
1584- componentRole = strdup(kAudioComponents[i].mRole);
1584+ componentRole = kAudioComponents[i].mRole;
15851585 codingType = kAudioComponents[i].mAudioCodingType;
15861586 codecID = kAudioComponents[i].mCodecID;
15871587 break;
--- a/omx/SoftFFmpegVideo.cpp
+++ b/omx/SoftFFmpegVideo.cpp
@@ -836,12 +836,12 @@ SoftOMXComponent* SoftFFmpegVideo::createSoftOMXComponent(
836836 return NULL;
837837
838838 OMX_VIDEO_CODINGTYPE codingType = OMX_VIDEO_CodingAutoDetect;
839- char *componentRole = NULL;
839+ const char *componentRole = NULL;
840840 enum AVCodecID codecID = AV_CODEC_ID_NONE;
841841
842842 for (size_t i = 0; i < kNumVideoComponents; ++i) {
843843 if (!strcasecmp(name, kVideoComponents[i].mName)) {
844- componentRole = strdup(kVideoComponents[i].mRole);
844+ componentRole = kVideoComponents[i].mRole;
845845 codingType = kVideoComponents[i].mVideoCodingType;
846846 codecID = kVideoComponents[i].mCodecID;
847847 break;
Show on old repository browser