Commit 494ba40f1c for aom
commit 494ba40f1cf5dfc0a945b941f2b31006a4b494ad
Author: Wan-Teh Chang <wtc@google.com>
Date: Fri Oct 2 15:57:58 2026 -0700
Assert ret val of av1_lookahead_peek() is not null
In av1_init_parallel_frame_context(), assert the return value of the
av1_lookahead_peek() call is not null.
Fix Coverity defect CID 564383 Dereference null return value.
Coverity is apparently affected by the two new av1_lookahead_peek()
calls added in
https://aomedia-review.googlesource.com/c/aom/+/216821. That CL did not
modify the av1_lookahead_peek() function. However, it checks the return
values of both av1_lookahead_peek() calls.
Change-Id: I529e96a034d7f2050741094d31be14c057c1bd73
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 5d62efddfb..add8abaab4 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -5772,6 +5772,7 @@ int av1_init_parallel_frame_context(const AV1_COMP_DATA *const first_cpi_data,
int src_index = gf_group->src_offset[i];
struct lookahead_entry *prev_source = av1_lookahead_peek(
ppi->lookahead, src_index - 1, cur_cpi->compressor_stage);
+ assert(prev_source != NULL);
// Save timestamps of prev frame.
cur_cpi->time_stamps.prev_ts_start = prev_source->ts_start;
cur_cpi->time_stamps.prev_ts_end = prev_source->ts_end;