[libvpx] scan-build: avoid dereference of null pointer

This commit is contained in:
Andrey Volk 2022-01-12 20:07:20 +03:00
parent b9b0b00912
commit 1499acac9d
1 changed files with 2 additions and 0 deletions

View File

@ -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--;