From: Andrey Volk Date: Wed, 12 Jan 2022 17:07:20 +0000 (+0300) Subject: [libvpx] scan-build: avoid dereference of null pointer X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb124e409bf38ef461fc951b22d5e848479b8289;p=thirdparty%2Ffreeswitch.git [libvpx] scan-build: avoid dereference of null pointer --- diff --git a/libs/libvpx/vp9/common/vp9_onyxc_int.h b/libs/libvpx/vp9/common/vp9_onyxc_int.h index 1cfc12f6fa..fb2ae018eb 100644 --- a/libs/libvpx/vp9/common/vp9_onyxc_int.h +++ b/libs/libvpx/vp9/common/vp9_onyxc_int.h @@ -349,6 +349,8 @@ static INLINE int get_free_fb(VP9_COMMON *cm) { static INLINE void ref_cnt_fb(RefCntBuffer *bufs, int *idx, int new_idx) { const int ref_index = *idx; + if (!bufs) return; + if (ref_index >= 0 && bufs[ref_index].ref_count > 0) bufs[ref_index].ref_count--;