Skip to content

Hard crash when setting font with invalid size #1327

@zbjornson

Description

@zbjornson

Steps to Reproduce

Since 96bdd4f, this will cause a hard crash from an empty MaybeLocal because parseFont returns undefined.

const {createCanvas} = require(".");
const ctx = createCanvas(10,10).getContext("2d");
ctx.font = "bold undefinedpx Arial";

Crashing at

Local<Object> font = Nan::To<Object>(parsed).ToLocalChecked();

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas): 96bdd4f
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): Win10, Node 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions