зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1038037 - B2G crash when opening malformed MP4A-LATM audio streaming over RTSP. r=sworkman
This commit is contained in:
Родитель
4162ea1110
Коммит
a8dda2393c
|
@ -215,12 +215,21 @@ static sp<ABuffer> MakeAVCCodecSpecificData(
|
||||||
}
|
}
|
||||||
|
|
||||||
sp<ABuffer> MakeAACCodecSpecificData(const char *params) {
|
sp<ABuffer> MakeAACCodecSpecificData(const char *params) {
|
||||||
|
if (!params || !strlen(params)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
AString val;
|
AString val;
|
||||||
CHECK(GetAttribute(params, "config", &val));
|
if (!GetAttribute(params, "config", &val)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sp<ABuffer> config = decodeHex(val);
|
sp<ABuffer> config = decodeHex(val);
|
||||||
CHECK(config != NULL);
|
if (!config.get()) {
|
||||||
CHECK_GE(config->size(), 4u);
|
return NULL;
|
||||||
|
}
|
||||||
|
if (config->size() < 4u) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
const uint8_t *data = config->data();
|
const uint8_t *data = config->data();
|
||||||
uint32_t x = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
|
uint32_t x = data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3];
|
||||||
|
@ -476,6 +485,10 @@ APacketSource::APacketSource(
|
||||||
|
|
||||||
sp<ABuffer> codecSpecificData =
|
sp<ABuffer> codecSpecificData =
|
||||||
MakeAACCodecSpecificData(params.c_str());
|
MakeAACCodecSpecificData(params.c_str());
|
||||||
|
if (!codecSpecificData.get()) {
|
||||||
|
mInitCheck = ERROR_UNSUPPORTED;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mFormat->setData(
|
mFormat->setData(
|
||||||
kKeyESDS, 0,
|
kKeyESDS, 0,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче