diff options
author | James Zern <jzern@google.com> | 2020-04-13 20:47:25 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-13 20:47:25 +0000 |
commit | c70ea5703b2b3faab704ff7e858f9105c85bca89 (patch) | |
tree | 5e21be8d5036778f1ba1f65c81c9e731674219c7 | |
parent | a16e349970963fb6de66c4c2b733d3d472c3cffa (diff) | |
parent | d38d0defd89baf7fbae57b23fb668a9d40237f81 (diff) | |
download | libvpx-c70ea5703b2b3faab704ff7e858f9105c85bca89.tar.gz |
external/libvpx: cherry-pick -Wunreachable-code-loop-increment fix am: 1feae85011 am: dd1818a77d am: d38d0defd8
Change-Id: I00fa1312b3b8446819780019ff728a0050d674ac
-rw-r--r-- | README.version | 1 | ||||
-rwxr-xr-x | libvpx/configure | 1 | ||||
-rw-r--r-- | libvpx/vpx/src/vpx_encoder.c | 13 |
3 files changed, 5 insertions, 10 deletions
diff --git a/README.version b/README.version index d11ef9a1f..1f4dd4af3 100644 --- a/README.version +++ b/README.version @@ -7,3 +7,4 @@ Local Modifications: 0f3fe088f vp8_decode: add missing vpx_clear_system_state 9cfcac1cb vp8,GetSigned: silence unsigned int overflow warning c713f8461 move common attribute defs to compiler_attributes.h + 223645aa8 vpx_codec_enc_config_default: rm unnecessary loop diff --git a/libvpx/configure b/libvpx/configure index 181e27b7c..f470cbe85 100755 --- a/libvpx/configure +++ b/libvpx/configure @@ -627,6 +627,7 @@ process_toolchain() { check_add_cflags -Wmissing-declarations check_add_cflags -Wmissing-prototypes check_add_cflags -Wuninitialized + check_add_cflags -Wunreachable-code-loop-increment check_add_cflags -Wunused check_add_cflags -Wextra # check_add_cflags also adds to cxxflags. gtest does not do well with diff --git a/libvpx/vpx/src/vpx_encoder.c b/libvpx/vpx/src/vpx_encoder.c index 6272502ce..f636b54a3 100644 --- a/libvpx/vpx/src/vpx_encoder.c +++ b/libvpx/vpx/src/vpx_encoder.c @@ -152,22 +152,15 @@ vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, vpx_codec_enc_cfg_t *cfg, unsigned int usage) { vpx_codec_err_t res; - vpx_codec_enc_cfg_map_t *map; - int i; if (!iface || !cfg || usage != 0) res = VPX_CODEC_INVALID_PARAM; else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) res = VPX_CODEC_INCAPABLE; else { - res = VPX_CODEC_INVALID_PARAM; - - for (i = 0; i < iface->enc.cfg_map_count; ++i) { - map = iface->enc.cfg_maps + i; - *cfg = map->cfg; - res = VPX_CODEC_OK; - break; - } + assert(iface->enc.cfg_map_count == 1); + *cfg = iface->enc.cfg_maps->cfg; + res = VPX_CODEC_OK; } return res; |