vcomp/cmpto_j2k, pool: alloc extra data

padding for conversions
This commit is contained in:
Martin Pulec
2024-09-03 14:54:21 +02:00
parent 62dece8d97
commit cc6b820db2
2 changed files with 5 additions and 3 deletions

View File

@@ -174,8 +174,9 @@ std::shared_ptr<video_frame> video_frame_pool::impl::get_frame() {
try {
ret = vf_alloc_desc(m_desc);
for (unsigned int i = 0; i < m_desc.tile_count; ++i) {
ret->tiles[i].data = (char *)
m_allocator->allocate(m_max_data_len);
ret->tiles[i].data =
(char *) m_allocator->allocate(
m_max_data_len + MAX_PADDING);
if (ret->tiles[i].data == NULL) {
throw std::runtime_error("Cannot allocate data");
}

View File

@@ -208,7 +208,8 @@ static bool configure_with(struct state_video_compress_j2k *s, struct video_desc
cuda_wrapper_free(s->cuda_conv_tmp_buf);
cuda_wrapper_malloc(
(void **) &s->cuda_conv_tmp_buf,
vc_get_datalen(desc.width, desc.height, desc.color_spec));
vc_get_datalen(desc.width, desc.height, desc.color_spec) +
MAX_PADDING);
}
#endif