ref: db2056f341e86218d3f7387023dc3b2d57258e8d
parent: fcd6414e77bf9c2e5062996c6e5e19689a2bda5f
parent: cf8f6559ce1b99df99bcda87a0f4d6ec5e29d571
author: James Zern <[email protected]>
date: Fri Sep 25 21:52:52 EDT 2015
Merge "vp9/10 encoder: prevent NULL access on failure"
--- a/vp10/encoder/encoder.c
+++ b/vp10/encoder/encoder.c
@@ -1820,7 +1820,7 @@
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;
@@ -1827,7 +1827,8 @@
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();
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1930,7 +1930,7 @@
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;
@@ -1937,7 +1937,8 @@
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();