diff options
Diffstat (limited to 'src/android/AudioPlayer_to_android.cpp')
-rw-r--r-- | src/android/AudioPlayer_to_android.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/android/AudioPlayer_to_android.cpp b/src/android/AudioPlayer_to_android.cpp index 73ee427..7d8ac44 100644 --- a/src/android/AudioPlayer_to_android.cpp +++ b/src/android/AudioPlayer_to_android.cpp @@ -1920,14 +1920,17 @@ SLresult android_audioPlayer_metadata_getValue(CAudioPlayer *ap, static_cast<android::AudioSfDecoder*>(ap->mAPlayer.get()); pValue->encoding = SL_CHARACTERENCODING_BINARY; memcpy((char *) pValue->langCountry, "en", 3); // applicable here? + SLuint32 valueData; SLuint32 valueSize = 0; + memcpy(&valueData, &pValue->data, sizeof(SLuint32)); if ((size < sizeof(SLMetadataInfo) || (!decoder->getPcmFormatValueSize(index, &valueSize)) || (!decoder->getPcmFormatKeyValue(index, size - sizeof(SLMetadataInfo), - (SLuint32*)pValue->data)))) { + &valueData)))) { res = SL_RESULT_PARAMETER_INVALID; } else { pValue->size = valueSize; + memcpy(&pValue->data, &valueData, sizeof(pValue->data)); } } break; |