History

lavfi/vf_libplacebo: add RGB colorspace sanity

Explicitly forbid using a non-RGB colorspace with RGB pixel format or vice versa. This mirrors identical logic from vf_scale.

Niklas Haas committed 3 years ago

Commit f6628011 parent c00fd021 file · +7 −0Browse files

Unified · Split

libavfilter/vf_libplacebo.c+7−0
@@ -697,6 +697,13 @@ static int output_frame_mix(AVFilterContext *ctx, · 696 unmodified lines
697697 if (s->color_primaries >= 0)
698698 out->color_primaries = s->color_primaries;
699699
700+ /* Sanity colorspace overrides */
701+ if (outdesc->flags & AV_PIX_FMT_FLAG_RGB) {
702+ out->colorspace = AVCOL_SPC_RGB;
703+ } else if (out->colorspace == AVCOL_SPC_RGB) {
704+ out->colorspace = AVCOL_SPC_UNSPECIFIED;
705+ }
706+
700707 changed_csp = ref->colorspace != out->colorspace ||
701708 ref->color_range != out->color_range ||
702709 ref->color_trc != out->color_trc ||

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t