Commits on Jun 21, 2021

  1. compose: Check optipng is there before we use it

    There are two places we can beef up the checks for optipng
    
      - When enabling its usage, make sure we found it first, and refuse to
        enable if we didn't.
      - In case `asc_compose_set_optipng_binary (NULL)` was called, check
        before spawning that we have *a* path. It's a programmer error to
        call `g_spawn_sync ()` with `NULL` in `argv[0]`, and the program
        will crash in that case. Also treat `NULL` as disabling optipng when
        passed to `asc_compose_set_optipng_binary`.
    
    In case the binary is removed mid-run or an invalid binary is passed to
    `asc_compose_set_optipng_binary`, the `g_spawn_sync` call itself will
    fail and we'll report a proper GError. This is the best way to handle
    it, as we avoid TOCTTOU races that way.
    Iain Lane committed Jun 21, 2021