Skip to content

Undefined-shift in de265_image::set_nonzero_coefficient #465

@bobfriesenhahn

Description

@bobfriesenhahn

Oss-fuzz testing of GraphicsMagick has resulted in oss-fuzz report 384182501. The set_nonzero_coefficient() inline function fails to assure that 'log2TrafoSize - tu_info.log2unitSize' is a positive value. For the provided test-case, the left shift request is -1. The computed value 'width' is used as one of the controlling values in two loops, so this may result in a security issue if the loops run for a very long time, or if the computed 'tu_info' array index is out of bounds. Since the result is "undefined behavior", the behavior may depend on the compiler and compilation options used.

This is the POC test-case that oss-fuzz produced (extension changed to allow upload):

clusterfuzz-testcase-minimized-coder_HEIF_fuzzer-5118858410655744 heif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions