Skip to content

Commit

Permalink
Fix broken demosaicing and out of bounds buffer access
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Martin <[email protected]>
  • Loading branch information
marcan committed Nov 27, 2010
1 parent c8211fd commit bf72ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cameras.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static void rgb_process(freenect_device *dev, uint8_t *pkt, int len)
uint8_t gt = dev->rgb_raw[i-640];
uint8_t gb = y == 479 ? gt : dev->rgb_raw[i+640];
uint8_t rtr = dev->rgb_raw[i-639];
uint8_t rbr = y == 479 ? rtr : dev->rgb_raw[i-641];
uint8_t rbr = y == 479 ? rtr : dev->rgb_raw[i+641];
uint8_t rtl = x == 0 ? rtr : dev->rgb_raw[i-641];
uint8_t rbl = x == 0 ? rbr : y == 479 ? rtl : dev->rgb_raw[i+639];
rgb_frame[3*i+0] = (rbl+rtl+rbr+rtr)>>2;
Expand Down

0 comments on commit bf72ae6

Please sign in to comment.