Bug 903993 - null check the SkStream's getFileName() before attempting to use it, as the SkStream may not be an SkFILEStream r=snorp

This commit is contained in:
George Wright 2013-08-29 12:24:26 -04:00
parent ba396ce9c5
commit 1c469e9f75

View File

@ -61,7 +61,12 @@ static ANPTypefaceStyle anp_getStyle(const ANPTypeface* tf) {
static int32_t anp_getFontPath(const ANPTypeface* tf, char fileName[],
int32_t length, int32_t* index) {
SkStream* stream = tf->openStream(index);
strcpy(fileName, stream->getFileName());
if (stream->getFileName()) {
strcpy(fileName, stream->getFileName());
} else {
return 0;
}
return strlen(fileName);
}