Bug 1385178. Do fallible allocation of our font data buffer in SyncLoadFontData. r=jfkthame

This commit is contained in:
Boris Zbarsky 2017-08-08 13:22:10 -04:00
Родитель 4c19212863
Коммит 69b153ce8c
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1437,7 +1437,7 @@ FontFaceSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad,
aBufferLength = static_cast<uint32_t>(bufferLength64);
// read all the decoded data
aBuffer = static_cast<uint8_t*> (moz_xmalloc(sizeof(uint8_t) * aBufferLength));
aBuffer = static_cast<uint8_t*>(malloc(sizeof(uint8_t) * aBufferLength));
if (!aBuffer) {
aBufferLength = 0;
return NS_ERROR_OUT_OF_MEMORY;