From 681c61ad3203d3a560f85f548feb136cb93c57e1 Mon Sep 17 00:00:00 2001 From: Jakub Karolczyk Date: Sun, 19 May 2024 16:18:53 +0100 Subject: [PATCH] [libvpx] Fix scan-build 14 --- libs/libvpx/vp9/encoder/vp9_subexp.c | 3 +++ libs/libvpx/vpx_scale/generic/vpx_scale.c | 2 ++ libs/libvpx/vpx_scale/vpx_scale.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/libs/libvpx/vp9/encoder/vp9_subexp.c b/libs/libvpx/vp9/encoder/vp9_subexp.c index cf17fcdfce..b5a2390662 100644 --- a/libs/libvpx/vp9/encoder/vp9_subexp.c +++ b/libs/libvpx/vp9/encoder/vp9_subexp.c @@ -64,6 +64,9 @@ static int remap_prob(int v, int m) { 228, 229, 17, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 18, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 19, }; + + assert(m > 0); + v--; m--; if ((m << 1) <= MAX_PROB) diff --git a/libs/libvpx/vpx_scale/generic/vpx_scale.c b/libs/libvpx/vpx_scale/generic/vpx_scale.c index 958bb320fc..e20905e9ce 100644 --- a/libs/libvpx/vpx_scale/generic/vpx_scale.c +++ b/libs/libvpx/vpx_scale/generic/vpx_scale.c @@ -167,6 +167,8 @@ static void scale1d_c(const unsigned char *source, int source_step, (void)source_length; + assert(dest_scale); + /* These asserts are needed if there are boundary issues... */ /*assert ( dest_scale > source_scale );*/ /*assert ( (source_length-1) * dest_scale >= (dest_length-1) * source_scale diff --git a/libs/libvpx/vpx_scale/vpx_scale.h b/libs/libvpx/vpx_scale/vpx_scale.h index fd5ba7ccdc..96edb7af20 100644 --- a/libs/libvpx/vpx_scale/vpx_scale.h +++ b/libs/libvpx/vpx_scale/vpx_scale.h @@ -11,6 +11,8 @@ #ifndef VPX_VPX_SCALE_VPX_SCALE_H_ #define VPX_VPX_SCALE_VPX_SCALE_H_ +#include + #include "vpx_scale/yv12config.h" extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,