diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-06 21:40:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-06 21:40:23 +0100 |
commit | 44e9d7f182bb3b6b4982f3243634c4a4a3d2b51d (patch) | |
tree | 1d3af3135be3f036ea85dcfab1eb8097c9183997 /libavfilter/vf_drawbox.c | |
parent | 2ca649f177e0808cd550cf4abde793c923b66db2 (diff) | |
download | ffmpeg-44e9d7f182bb3b6b4982f3243634c4a4a3d2b51d.tar.gz |
vf_drawbox: dont move uninitialized and then unused colors around
Fixes CID741419
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_drawbox.c')
-rw-r--r-- | libavfilter/vf_drawbox.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index ecedb21aee..3509ccd49a 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -82,10 +82,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) else if (av_parse_color(rgba_color, drawbox->color_str, -1, ctx) < 0) return AVERROR(EINVAL); - drawbox->yuv_color[Y] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]); - drawbox->yuv_color[U] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); - drawbox->yuv_color[V] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); - drawbox->yuv_color[A] = rgba_color[3]; + if (!drawbox->invert_color) { + drawbox->yuv_color[Y] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], rgba_color[2]); + drawbox->yuv_color[U] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + drawbox->yuv_color[V] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], rgba_color[2], 0); + drawbox->yuv_color[A] = rgba_color[3]; + } return 0; } |