mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fixed overflow situation
This commit is contained in:
parent
68654e70a9
commit
2bc29c766b
@ -1028,6 +1028,11 @@ static void jpeg_check_highwater(jpeg_buf_t *jpeg_buf)
|
||||
if (jpeg_buf->realloc == false) {
|
||||
// Can't realloc buffer
|
||||
jpeg_buf->overflow = true;
|
||||
// Reset length so that the next data writes won't go past
|
||||
// the end of the existing buffer. This will allow the encode
|
||||
// to finish and the overflow flag will show the caller that
|
||||
// there was a failure due to too small an output buffer.
|
||||
jpeg_buf->length = 0;
|
||||
return;
|
||||
}
|
||||
jpeg_buf->length += 1024;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user