Merge "vp9/10 encoder: prevent NULL access on failure"
diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c
index b455bbb..1d95d7d 100644
--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -1820,14 +1820,15 @@
snprintf((H) + strlen(H), sizeof(H) - strlen(H), (T), (V))
void vp10_remove_compressor(VP10_COMP *cpi) {
- VP10_COMMON *const cm = &cpi->common;
+ VP10_COMMON *cm;
unsigned int i;
int t;
if (!cpi)
return;
- if (cpi && (cm->current_video_frame > 0)) {
+ cm = &cpi->common;
+ if (cm->current_video_frame > 0) {
#if CONFIG_INTERNAL_STATS
vpx_clear_system_state();
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index eb0d360..b2e800d 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1930,14 +1930,15 @@
snprintf((H) + strlen(H), sizeof(H) - strlen(H), (T), (V))
void vp9_remove_compressor(VP9_COMP *cpi) {
- VP9_COMMON *const cm = &cpi->common;
+ VP9_COMMON *cm;
unsigned int i;
int t;
if (!cpi)
return;
- if (cpi && (cm->current_video_frame > 0)) {
+ cm = &cpi->common;
+ if (cm->current_video_frame > 0) {
#if CONFIG_INTERNAL_STATS
vpx_clear_system_state();