Skip to content

Histogram AudioLevels accepts frames too narrow for audio bars #43

Description

@msg7086

> Analysis attribution: This issue analysis was created by Codex GPT.
> The GitHub user who submits this issue does not claim authorship of the analysis.

Finding

  • Finding ID: B11-histogram-audio-levels-width
  • Status: Reproduced defect
  • Severity: Medium
  • Affected component: Histogram AudioLevels
  • Source location: avs_core/filters/histogram.cpp:240-253 and 287-301

Summary

Construction does not verify that the frame can hold required audio bars and labels; runtime bar width can become zero.

Affected Code

const int w = src->GetRowSize();
const int channels = vi.AudioChannels();

int bar_w = 60;
int total_width = (1+channels*2)*bar_w;

if (total_width > w) {
  bar_w = ((w / (1+channels*2)) / 4)* 4;
}
total_width = (1+channels*2)*bar_w;

Correct Behavior

Reject insufficient geometry at construction before any bar width can become non-positive.

Reproduction

Construct AudioLevels for an 8x32 YV12 frame with two audio channels.

Observed Result

observed: construction succeeds
expected: AvisynthError

Impact

Unsupported geometry reaches rendering calculations.

Validation Criteria

Too-narrow frames fail; minimum legal dimensions render nonzero bars.

Version and Environment

  • AviSynthPlus revision: 815780226951f95dfc1fc74f1df90ef98824fcf5
  • Platform and compiler: Linux x86_64 / Clang 22 debug
  • CPU features used: host-default build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions