aboutsummaryrefslogtreecommitdiff
path: root/libvpx/examples/twopass_encoder.c
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-08 12:06:17 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-08 12:06:17 +0000
commitd6f23fa1d6d08bf56584be7689b9560a242e22fa (patch)
tree6e0cca478f6f9e96e806f4af167201155c0a30a8 /libvpx/examples/twopass_encoder.c
parent0e4073417f6db7af294f1af0c5bc45c384c51b8f (diff)
parent6939824c0cf8321a1718973892371085f7b4edff (diff)
downloadlibvpx-d6f23fa1d6d08bf56584be7689b9560a242e22fa.tar.gz
Change-Id: I7d6734d12edd22ecfbec51f472ce6e08422b2595
Diffstat (limited to 'libvpx/examples/twopass_encoder.c')
-rw-r--r--libvpx/examples/twopass_encoder.c3
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()));