Use C11 variable declaration in av1_decoder_create
This allows us to check for 'pbi' allocation failure immediately and
simplify the initialization of 'cm'.
Change-Id: I4bcebc022abe79015d86ff19bdbaa2831d07891a
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c
index 9572f36..7860aaa 100644
--- a/av1/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -71,12 +71,11 @@
AV1Decoder *av1_decoder_create(BufferPool *const pool) {
AV1Decoder *volatile const pbi = aom_memalign(32, sizeof(*pbi));
- AV1_COMMON *volatile const cm = pbi ? &pbi->common : NULL;
-
- if (!cm) return NULL;
-
+ if (!pbi) return NULL;
av1_zero(*pbi);
+ AV1_COMMON *volatile const cm = &pbi->common;
+
// The jmp_buf is valid only for the duration of the function that calls
// setjmp(). Therefore, this function must reset the 'setjmp' field to 0
// before it returns.