Skip to content

Commit e761304

Browse files
authored
make sure sensor mode has unsigned fields (#43)
1 parent d32f9c1 commit e761304

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static int create_dma_allocator() {
7676

7777
// https://github.com/raspberrypi/libcamera-apps/blob/dd97618a25523c2c4aa58f87af5f23e49aa6069c/core/libcamera_app.cpp#L42
7878
static PixelFormat mode_to_pixel_format(sensor_mode_t *mode) {
79-
static std::vector<std::pair<std::pair<int, bool>, PixelFormat>> table = {
79+
static std::vector<std::pair<std::pair<unsigned int, bool>, PixelFormat>> table = {
8080
{ {8, false}, formats::SBGGR8 },
8181
{ {8, true}, formats::SBGGR8 },
8282
{ {10, false}, formats::SBGGR10 },

sensor_mode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#include <stdbool.h>
55

66
typedef struct {
7-
int width;
8-
int height;
9-
int bit_depth;
7+
unsigned int width;
8+
unsigned int height;
9+
unsigned int bit_depth;
1010
bool packed;
1111
} sensor_mode_t;
1212

0 commit comments

Comments
 (0)