]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libvpx] Fix scan-build 14 2464/head
authorJakub Karolczyk <jakub.karolczyk@signalwire.com>
Sun, 19 May 2024 15:18:53 +0000 (16:18 +0100)
committerJakub Karolczyk <jakub.karolczyk@signalwire.com>
Sun, 19 May 2024 15:18:53 +0000 (16:18 +0100)
libs/libvpx/vp9/encoder/vp9_subexp.c
libs/libvpx/vpx_scale/generic/vpx_scale.c
libs/libvpx/vpx_scale/vpx_scale.h

index cf17fcdfcec118eeac5d5dbf56f9be42a1c26018..b5a23906628c20ac96ddabcd96fc091f828299f4 100644 (file)
@@ -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)
index 958bb320fc4149f91c81bc1bfc0a445e99df658c..e20905e9ce35a6afb10a9043ab5dccb2e3a56eba 100644 (file)
@@ -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
index fd5ba7ccdc166c27ba0550d7d98389f032ce1bdb..96edb7af20d466c052af6902179fcf7da09fb524 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef VPX_VPX_SCALE_VPX_SCALE_H_
 #define VPX_VPX_SCALE_VPX_SCALE_H_
 
+#include <assert.h>
+
 #include "vpx_scale/yv12config.h"
 
 extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,