@ -219,6 +219,8 @@ vkr_cs_decoder_gc_temp_pool(struct vkr_cs_decoder *dec)
pool - > reset_to = pool - > buffers [ 0 ] ;
pool - > reset_to = pool - > buffers [ 0 ] ;
pool - > cur = pool - > buffers [ 0 ] ;
pool - > cur = pool - > buffers [ 0 ] ;
pool - > total_size = pool - > end - pool - > cur ;
vkr_cs_decoder_sanity_check ( dec ) ;
vkr_cs_decoder_sanity_check ( dec ) ;
}
}
@ -332,10 +334,14 @@ vkr_cs_decoder_alloc_temp_internal(struct vkr_cs_decoder *dec, size_t size)
if ( ! buf_size )
if ( ! buf_size )
return false ;
return false ;
if ( buf_size > VKR_CS_DECODER_TEMP_POOL_MAX_SIZE - pool - > total_size )
return false ;
uint8_t * buf = malloc ( buf_size ) ;
uint8_t * buf = malloc ( buf_size ) ;
if ( ! buf )
if ( ! buf )
return false ;
return false ;
pool - > total_size + = buf_size ;
pool - > buffers [ pool - > buffer_count + + ] = buf ;
pool - > buffers [ pool - > buffer_count + + ] = buf ;
pool - > reset_to = buf ;
pool - > reset_to = buf ;
pool - > cur = buf ;
pool - > cur = buf ;