From: James Zern Date: Thu, 24 Sep 2015 00:55:51 +0000 (-0700) Subject: vp9/10 encoder: prevent NULL access on failure X-Git-Tag: v1.5.0~113^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf8f6559ce1b99df99bcda87a0f4d6ec5e29d571;p=platform%2Fupstream%2Flibvpx.git vp9/10 encoder: prevent NULL access on failure Change-Id: I1fc8e0b3d48675cd5428b7b36f7cc28ab32cbf71 --- diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c index 6ae4c5e..d5545a0 100644 --- a/vp10/encoder/encoder.c +++ b/vp10/encoder/encoder.c @@ -1820,14 +1820,15 @@ VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf, 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 91e92ff..aca289f 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -1927,14 +1927,15 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf, 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();