diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-08 12:06:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-08 12:06:17 +0000 |
commit | d6f23fa1d6d08bf56584be7689b9560a242e22fa (patch) | |
tree | 6e0cca478f6f9e96e806f4af167201155c0a30a8 /libvpx/examples/twopass_encoder.c | |
parent | 0e4073417f6db7af294f1af0c5bc45c384c51b8f (diff) | |
parent | 6939824c0cf8321a1718973892371085f7b4edff (diff) | |
download | libvpx-d6f23fa1d6d08bf56584be7689b9560a242e22fa.tar.gz |
Snap for 8917908 from 6939824c0cf8321a1718973892371085f7b4edff to mainline-wifi-releaseaml_wif_331810010aml_wif_331710030aml_wif_331613000aml_wif_331511020aml_wif_331414000aml_wif_331310070aml_wif_331112000aml_wif_331016070android13-mainline-wifi-release
Change-Id: I7d6734d12edd22ecfbec51f472ce6e08422b2595
Diffstat (limited to 'libvpx/examples/twopass_encoder.c')
-rw-r--r-- | libvpx/examples/twopass_encoder.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libvpx/examples/twopass_encoder.c b/libvpx/examples/twopass_encoder.c index 3d950b2c4..07a10d9cf 100644 --- a/libvpx/examples/twopass_encoder.c +++ b/libvpx/examples/twopass_encoder.c @@ -84,6 +84,7 @@ static int get_frame_stats(vpx_codec_ctx_t *ctx, const vpx_image_t *img, const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf; const size_t pkt_size = pkt->data.twopass_stats.sz; stats->buf = realloc(stats->buf, stats->sz + pkt_size); + if (!stats->buf) die("Failed to reallocate stats buffer."); memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size); stats->sz += pkt_size; } @@ -221,7 +222,7 @@ int main(int argc, char **argv) { die("Invalid frame size: %dx%d", w, h); if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, w, h, 1)) - die("Failed to allocate image", w, h); + die("Failed to allocate image (%dx%d)", w, h); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface())); |