mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
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:
parent
ba396ce9c5
commit
1c469e9f75
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user