Remove unneeded null check for entry in for loop
authorWan-Teh Chang <wtc@google.com>
Mon, 4 May 2020 18:18:22 +0000 (11:18 -0700)
committerWan-Teh Chang <wtc@google.com>
Mon, 4 May 2020 18:21:25 +0000 (11:21 -0700)
In vpx_codec_control_(), before we enter the for loop, we have already
checked if ctx->iface->ctrl_maps is null and handle that as an error. So
the for loop can assume ctx->iface->ctrl_maps is not null, which implies
'entry' is not null (both initially and after entry++).

Change-Id: Ieafe464d4111fdb77f0586ecfa1835d1cfd44d94

vpx/src/vpx_codec.c

index 10331aa..114b94e 100644 (file)
@@ -97,7 +97,7 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id, ...) {
 
     res = VPX_CODEC_INCAPABLE;
 
-    for (entry = ctx->iface->ctrl_maps; entry && entry->fn; entry++) {
+    for (entry = ctx->iface->ctrl_maps; entry->fn; entry++) {
       if (!entry->ctrl_id || entry->ctrl_id == ctrl_id) {
         va_list ap;