some asserts

This commit is contained in:
Devaev Maxim
2018-09-27 05:08:43 +03:00
parent 43800a5ed6
commit 74699b63e7
2 changed files with 2 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ void jpeg_encoder_compress_buffer(struct device_t *dev, int index) {
jpeg_destroy_compress(&jpeg);
free(line_buffer);
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) {