Index: media/libvpx/libvpx/vp8/common/alloccommon.c =================================================================== --- media/libvpx/libvpx/vp8/common/alloccommon.c +++ media/libvpx/libvpx/vp8/common/alloccommon.c @@ -36,26 +36,22 @@ vpx_free(oci->pp_limits_buffer); oci->pp_limits_buffer = NULL; vpx_free(oci->postproc_state.generated_noise); - memset(&oci->postproc_state, 0, sizeof(oci->postproc_state)); + oci->postproc_state.generated_noise = NULL; #endif vpx_free(oci->above_context); vpx_free(oci->mip); #if CONFIG_ERROR_CONCEALMENT vpx_free(oci->prev_mip); oci->prev_mip = NULL; - oci->prev_mi = NULL; #endif oci->above_context = NULL; oci->mip = NULL; - oci->mi = NULL; - oci->show_frame_mi = NULL; - oci->frame_to_show = NULL; } int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) { int i; Index: media/libvpx/libvpx/vp8/vp8_cx_iface.c =================================================================== --- media/libvpx/libvpx/vp8/vp8_cx_iface.c +++ media/libvpx/libvpx/vp8/vp8_cx_iface.c @@ -1043,14 +1043,23 @@ dst_end_time_stamp = pts_end * ctx->timestamp_ratio.num / ctx->timestamp_ratio.den; res = image2yuvconfig(img, &sd); - if (vp8_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags, &sd, - dst_time_stamp, dst_end_time_stamp)) { - VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; - res = update_error_state(ctx, &cpi->common.error); + if (sd.y_width != ctx->cfg.g_w || sd.y_height != ctx->cfg.g_h) { + /* from vpx_encoder.h for g_w/g_h: + "Note that the frames passed as input to the encoder must have this + resolution" + */ + ctx->base.err_detail = "Invalid input frame resolution"; + res = VPX_CODEC_INVALID_PARAM; + } else { + if (vp8_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags, + &sd, dst_time_stamp, dst_end_time_stamp)) { + VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; + res = update_error_state(ctx, &cpi->common.error); + } } /* reset for next frame */ ctx->next_frame_flag = 0; } Index: media/libvpx/libvpx/vp9/vp9_cx_iface.c =================================================================== --- media/libvpx/libvpx/vp9/vp9_cx_iface.c +++ media/libvpx/libvpx/vp9/vp9_cx_iface.c @@ -1551,17 +1551,26 @@ } const int64_t dst_end_time_stamp = timebase_units_to_ticks(timebase_in_ts, pts_end); res = image2yuvconfig(img, &sd); - // Store the original flags in to the frame buffer. Will extract the - // key frame flag when we actually encode this frame. - if (vp9_receive_raw_frame(cpi, flags | ctx->next_frame_flags, &sd, - dst_time_stamp, dst_end_time_stamp)) { - res = update_error_state(ctx, &cpi->common.error); + if (sd.y_width != ctx->cfg.g_w || sd.y_height != ctx->cfg.g_h) { + /* from vpx_encoder.h for g_w/g_h: + "Note that the frames passed as input to the encoder must have this + resolution" + */ + ctx->base.err_detail = "Invalid input frame resolution"; + res = VPX_CODEC_INVALID_PARAM; + } else { + // Store the original flags in to the frame buffer. Will extract the + // key frame flag when we actually encode this frame. + if (vp9_receive_raw_frame(cpi, flags | ctx->next_frame_flags, &sd, + dst_time_stamp, dst_end_time_stamp)) { + res = update_error_state(ctx, &cpi->common.error); + } + ctx->next_frame_flags = 0; } - ctx->next_frame_flags = 0; } cx_data = ctx->cx_data; cx_data_sz = ctx->cx_data_sz; Index: media/libvpx/libvpx/vpx_ports/aarch64_cpudetect.c =================================================================== --- media/libvpx/libvpx/vpx_ports/aarch64_cpudetect.c +++ media/libvpx/libvpx/vpx_ports/aarch64_cpudetect.c @@ -14,11 +14,11 @@ #if defined(__APPLE__) #include #endif -#if !CONFIG_RUNTIME_CPU_DETECT +#if !CONFIG_RUNTIME_CPU_DETECT || defined(__OpenBSD__) static int arm_get_cpu_caps(void) { // This function should actually be a no-op. There is no way to adjust any of // these because the RTCD tables do not exist: the functions are called // statically. @@ -27,11 +27,11 @@ flags |= HAS_NEON; #endif // HAVE_NEON return flags; } -#elif defined(__APPLE__) // end !CONFIG_RUNTIME_CPU_DETECT +#elif defined(__APPLE__) // end !CONFIG_RUNTIME_CPU_DETECT || defined(__OpenBSD__) // sysctlbyname() parameter documentation for instruction set characteristics: // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics static INLINE int64_t have_feature(const char *feature) { int64_t feature_present = 0; Index: media/libvpx/libvpx/vpx_util/vpx_pthread.h =================================================================== --- media/libvpx/libvpx/vpx_util/vpx_pthread.h +++ media/libvpx/libvpx/vpx_util/vpx_pthread.h @@ -24,10 +24,11 @@ // Prevent leaking max/min macros. #undef NOMINMAX #define NOMINMAX #undef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#include // NOLINT #include // NOLINT #include // NOLINT #include // NOLINT typedef HANDLE pthread_t; typedef SRWLOCK pthread_mutex_t;