Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPX output: fix write errors #3672

Merged
merged 1 commit into from
Nov 16, 2022

Commits on Nov 15, 2022

  1. DPX output: fix write errors

    There was a subtle error where we has a reference to an ImageSpec for
    one of the subimages, confusingly called m_spec, which we altered, but
    then didn't make the same change to the this->m_spec, and in a later
    spot we referenced the `m_spec` meaning the one in this. This could
    lead to a crash.
    
    Fix, but not only that, rename to avoid the confusion. `spec0` is the
    alias we us for the spec for subimage 0, and `spec_s` is the alias we
    use when referencing subimage N, and we really never use m_spec
    anymore to avoi any confusion. This should make it easier to reason
    about this code in the future and avoid thise kinds of mistakes.
    
    A second error resulted from the situation where a failure in open()
    would return before one or both of m_buf or m_tilebuf were allocated.
    If the return status of open() were ignored and the caller
    subsequently attempted calls to write_scanline or write_tile, invalid
    memory could be accessed. Fix this with a variety of guards not only
    based on the allocation status of these buffers, but also issuing
    errors (and exiting early) from write_scanline or write_tile if they
    are called on an ImageInput that is not in fact open.
    
    (Addresses 1651, 1652)
    lgritz committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    4b94e02 View commit details
    Browse the repository at this point in the history