diff mbox

[FFmpeg-devel] vf_zscale: Fix alpha destination graph for floating point pixel formats

Message ID 20171207213300.15256-1-vittorio.giovara@gmail.com
State Accepted
Commit bc38c8f4424982617a92d1cefa7fdcb640a80234
Headers show

Commit Message

Vittorio Giovara Dec. 7, 2017, 9:33 p.m. UTC
This was setting the input pixel type instead of the output one,
leading to incorrect data being fed to the library.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
---
 libavfilter/vf_zscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Dec. 8, 2017, 8:47 a.m. UTC | #1
On 12/7/17, Vittorio Giovara <vittorio.giovara@gmail.com> wrote:
> This was setting the input pixel type instead of the output one,
> leading to incorrect data being fed to the library.
>
> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
> ---
>  libavfilter/vf_zscale.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM
diff mbox

Patch

diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index 865910bd87..6e1d36cb4c 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -615,7 +615,7 @@  static int filter_frame(AVFilterLink *link, AVFrame *in)
             s->alpha_dst_format.width = out->width;
             s->alpha_dst_format.height = out->height;
             s->alpha_dst_format.depth = odesc->comp[0].depth;
-            s->alpha_dst_format.pixel_type = (desc->flags & AV_PIX_FMT_FLAG_FLOAT) ? ZIMG_PIXEL_FLOAT : odesc->comp[0].depth > 8 ? ZIMG_PIXEL_WORD : ZIMG_PIXEL_BYTE;
+            s->alpha_dst_format.pixel_type = (odesc->flags & AV_PIX_FMT_FLAG_FLOAT) ? ZIMG_PIXEL_FLOAT : odesc->comp[0].depth > 8 ? ZIMG_PIXEL_WORD : ZIMG_PIXEL_BYTE;
             s->alpha_dst_format.color_family = ZIMG_COLOR_GREY;
 
             zimg_filter_graph_free(s->alpha_graph);