mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-26 23:36:16 +00:00
some asserts
This commit is contained in:
@@ -110,6 +110,7 @@ void jpeg_encoder_compress_buffer(struct device_t *dev, int index) {
|
|||||||
jpeg_destroy_compress(&jpeg);
|
jpeg_destroy_compress(&jpeg);
|
||||||
free(line_buffer);
|
free(line_buffer);
|
||||||
assert(dev->run->pictures[index].size > 0);
|
assert(dev->run->pictures[index].size > 0);
|
||||||
|
assert(dev->run->pictures[index].size <= dev->run->max_picture_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _jpeg_set_dest_picture(j_compress_ptr jpeg, unsigned char *picture, unsigned long *written) {
|
static void _jpeg_set_dest_picture(j_compress_ptr jpeg, unsigned char *picture, unsigned long *written) {
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ int omx_encoder_compress_buffer(struct omx_encoder_t *omx, struct device_t *dev,
|
|||||||
omx->output_buffer->pBuffer,
|
omx->output_buffer->pBuffer,
|
||||||
omx->output_buffer->nFilledLen
|
omx->output_buffer->nFilledLen
|
||||||
);
|
);
|
||||||
|
assert(dev->run->pictures[index].size + omx->output_buffer->nFilledLen <= dev->run->max_picture_size);
|
||||||
dev->run->pictures[index].size += omx->output_buffer->nFilledLen;
|
dev->run->pictures[index].size += omx->output_buffer->nFilledLen;
|
||||||
|
|
||||||
if (omx->output_buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
|
if (omx->output_buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
|
||||||
|
|||||||
Reference in New Issue
Block a user