Silence a spurious compiler warning
In some configurations, when using gcc 13.2.0, the compiler can
warn that the variable `error` in sync_fpmt_workers may be used
without being initialized.
This is a spurious warning - in fact, the compiler seems to be
able to tell that this code is fine in normal builds, and only
produces a warning when building with optimizations and assertions
both enabled, e.g.:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DAOM_EXTRA_C_FLAGS="-UNDEBUG"
Prevent this warning by adding an explicit initializer.
Change-Id: I7fffcec2cdc6985f9c5767aaa307906d5c2495c1
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index ccb38f7..5287ded 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -1417,7 +1417,7 @@
int num_workers = ppi->p_mt_info.p_num_workers;
int had_error = 0;
// Points to error in the earliest display order frame in the parallel set.
- const struct aom_internal_error_info *error;
+ const struct aom_internal_error_info *error = NULL;
// Encoding ends.
for (int i = num_workers - 1; i >= 0; --i) {