Skip to content

Commit 12c147f

Browse files
Update framesize validation to check FRAMESIZE_5MP (#810)
Change error logging from error to warning for invalid framesize and set framesize to FRAMESIZE_5MP if it exceeds the limit.
1 parent bcbb2ad commit 12c147f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sensors/ov5640.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ static int set_framesize(sensor_t *sensor, framesize_t framesize)
384384
framesize_t old_framesize = sensor->status.framesize;
385385
sensor->status.framesize = framesize;
386386

387-
if(framesize > FRAMESIZE_QSXGA){
388-
ESP_LOGE(TAG, "Invalid framesize: %u", framesize);
389-
return -1;
387+
if (framesize > FRAMESIZE_5MP) {
388+
ESP_LOGW(TAG, "Invalid framesize: %u", framesize);
389+
framesize = FRAMESIZE_5MP;
390390
}
391391
uint16_t w = resolution[framesize].width;
392392
uint16_t h = resolution[framesize].height;

0 commit comments

Comments
 (0)