diff options
author | liuchao <liuchao741@huawei.com> | 2017-02-23 12:05:54 +0800 |
---|---|---|
committer | liuchao <liuchao741@huawei.com> | 2017-02-23 14:22:01 +0800 |
commit | 64bd48e21b42107fe93ac8bc0fb8cc24bb8643df (patch) | |
tree | 68077b14de1d24d36ef7cce1c5bdc271cbcf5342 /libAACenc | |
parent | b82c85d0b1ee364ca20e2e9222ea4b6b39d917d3 (diff) | |
download | fdk-aac-64bd48e21b42107fe93ac8bc0fb8cc24bb8643df.tar.gz fdk-aac-64bd48e21b42107fe93ac8bc0fb8cc24bb8643df.tar.bz2 fdk-aac-64bd48e21b42107fe93ac8bc0fb8cc24bb8643df.zip |
Fix not properly handled NULL-pointer access before check in aac lib
1) Fixes some potential NULL-pointer access in case input pointer is
passed NULL
2) Modified some for lazy init
Test: mm -j 8
Change-Id: I7fca97e1d9f70d8e8c1533b519181af35a5468f7
Diffstat (limited to 'libAACenc')
-rw-r--r-- | libAACenc/src/metadata_main.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libAACenc/src/metadata_main.cpp b/libAACenc/src/metadata_main.cpp index e920793..90f8f4e 100644 --- a/libAACenc/src/metadata_main.cpp +++ b/libAACenc/src/metadata_main.cpp @@ -488,14 +488,12 @@ static FDK_METADATA_ERROR ProcessCompressor( { FDK_METADATA_ERROR err = METADATA_OK; - INT dynrng, compr; - DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile); - DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile); - if ( (pMetadata==NULL) || (hDrcComp==NULL) ) { err = METADATA_INVALID_HANDLE; return err; } + DRC_PROFILE profileDrc = convertProfile(pMetadata->mpegDrc.drc_profile); + DRC_PROFILE profileComp = convertProfile(pMetadata->etsiAncData.comp_profile); /* first, check if profile is same as last frame * otherwise, update setup */ @@ -511,8 +509,8 @@ static FDK_METADATA_ERROR ProcessCompressor( } /* in case of embedding external values, copy this now (limiter may overwrite them) */ - dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]); - compr = decodeCompr(pMetadata->etsiAncData.compression_value); + INT dynrng = decodeDynrng(pMetadata->mpegDrc.dyn_rng_ctl[0], pMetadata->mpegDrc.dyn_rng_sgn[0]); + INT compr = decodeCompr(pMetadata->etsiAncData.compression_value); /* Call compressor */ if (FDK_DRC_Generator_Calc(hDrcComp, |