Commit 6181313122 for aom
commit 6181313122767d38752d938b565dec1c0abe1892
Author: Wan-Teh Chang <wtc@google.com>
Date: Thu Sep 24 09:20:27 2026 -0700
Assert rd_stats* not null in motion_mode_rd()
Assert the rd_stats, rd_stats_y, and rd_stats_uv parameters are not null
in motion_mode_rd() and handle_inter_mode().
Fixes Coverity defect CID 564327 (Dereference after null check).
Change-Id: I597fe549ecc07cd03628db2cb65c46a7a4682c84
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 68e95e58e1..77259ba3bd 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -1553,6 +1553,7 @@ static int64_t motion_mode_rd(
int64_t *ref_skip_rd, int *rate_mv, const BUFFER_SET *orig_dst,
int64_t *best_est_rd, int do_tx_search, InterModesInfo *inter_modes_info,
int eval_motion_mode, int64_t *yrd) {
+ assert(rd_stats != NULL && rd_stats_y != NULL && rd_stats_uv != NULL);
const AV1_COMMON *const cm = &cpi->common;
const FeatureFlags *const features = &cm->features;
TxfmSearchInfo *txfm_info = &x->txfm_search_info;
@@ -3084,6 +3085,7 @@ static int64_t handle_inter_mode(
InterModesInfo *inter_modes_info, motion_mode_candidate *motion_mode_cand,
int64_t *skip_rd, PruneInfoFromTpl *inter_cost_info_from_tpl,
int64_t *yrd) {
+ assert(rd_stats != NULL && rd_stats_y != NULL && rd_stats_uv != NULL);
const AV1_COMMON *cm = &cpi->common;
const int num_planes = av1_num_planes(cm);
MACROBLOCKD *xd = &x->e_mbd;