From: Andrey Volk Date: Wed, 12 Jan 2022 17:07:20 +0000 (+0300) Subject: [libvpx] scan-build: avoid dereference of null pointer X-Git-Tag: v1.10.8^2~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1499acac9ddf8fd0ae2ce91a3a8ef2cd715b1f48;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 662b8ef5e1..c5b98c0021 100644 --- a/libs/libvpx/vp9/common/vp9_onyxc_int.h +++ b/libs/libvpx/vp9/common/vp9_onyxc_int.h @@ -299,6 +299,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--;