aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_drawbox.c
diff options
context:
space:
mode:
authorTing Fu <ting.fu@intel.com>2021-06-04 10:22:45 +0800
committerGuo Yejun <yejun.guo@intel.com>2021-06-09 09:18:02 +0800
commit22d99589d8147913a2fad8ba23fca24f6d3f92c3 (patch)
tree41d9418683f562765d626c8786c30c16afeb7f96 /libavfilter/vf_drawbox.c
parent58614f7beee87709dabb9ecc9a709e76f68e49cc (diff)
downloadffmpeg-22d99589d8147913a2fad8ba23fca24f6d3f92c3.tar.gz
lavfi/vf_drawbox.c: fix CID 1485004
CID 1485004: Uninitialized variables (UNINIT) Using uninitialized value "x" when calling "*pixel_belongs_to_region". Signed-off-by: Ting Fu <ting.fu@intel.com>
Diffstat (limited to 'libavfilter/vf_drawbox.c')
-rw-r--r--libavfilter/vf_drawbox.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index fff78862e9..1e9e028650 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -126,8 +126,9 @@ static void draw_region(AVFrame *frame, DrawBoxContext *ctx, int left, int top,
for (y = top; y < down; y++) {
ASSIGN_THREE_CHANNELS
if (ctx->invert_color) {
- if (pixel_belongs_to_region(ctx, x, y))
- row[0][x] = 0xff - row[0][x];
+ for (x = left; x < right; x++)
+ if (pixel_belongs_to_region(ctx, x, y))
+ row[0][x] = 0xff - row[0][x];
} else {
for (x = left; x < right; x++) {
double alpha = (double)ctx->yuv_color[A] / 255;