Need to read up to 43 bytes of data, reading incorrectly.

I took a couple of minutes to play with your packet input logic and came up with three different ways to code essentially the same logic. The first is how I would prefer to do the job if it were my project:

/*----------------------------------------------------------------------------*/
/* Read a data packet from the AVRcam (Method 1, use input function)          */
/*----------------------------------------------------------------------------*/
unsigned char gcam(void)
{  while (!cam.available());           /* Wait for data to arrive             */
   return cam.read();                  /* Return received character           */
}                                      /*  end: gcam()                        */
unsigned char *get_packet(char *buf)
{  unsigned char n,*p;                 /* Nr bounding boxes, buffer pointer   */
   for(;;)                             /* Until good packet received          */
   {  while (0x0A != getb());          /* Wait for a LF byte                  */
      if (8 < (n = getb())) continue;  /* Go around again if invalid count    */
      *(p = buf) = n;                  /* Set pointer to buffer, save count   */
      for (n*=5; n--; *++p = getb());  /* Read data to buffer following count */
      if (0xFF == getb()) break;       /* Done if following byte is RO        */
   }                                   /*  end: until good packet received    */
   return buf;                         /* Return pointer to input data        */
}                                      /*  end: get_packet()                  */
/*----------------------------------------------------------------------------*/

The second is what I might try if I decided that I needed to save the overhead of a function call to read each byte:

/*----------------------------------------------------------------------------*/
/* Read a data packet from the AVRcam (Method 2, in-lined reads)              */
/*----------------------------------------------------------------------------*/
unsigned char *get_packet(char *buf)
{  unsigned char n,*p;
   for (;;)
   {  do
      {  while (!cam.available());
      }  while (0x0A != cam.read());
      while (!cam.available());
      if (8 < (n = cam.read())) continue;
      *(p = buf) = n;
      for (n*=5; n--;)
      {  while (!cam.available());
         *++p = cam.read();
      }
      while (!cam.available());
      if (0xFF == cam.read()) break;
   }
   return buf;
}
/*----------------------------------------------------------------------------*/

and the third is what I might try if I felt I needed to eliminate as much call overhead as possible by in-lining the code:

/*----------------------------------------------------------------------------*/
/* Read a data packet from the AVRcam (Method 3, in-lined code)               */
/*----------------------------------------------------------------------------*/
   unsigned char n,*p,buf[41];
   
   for (;;)
   {  do
      {  while (!cam.available());
      }  while (0x0A != cam.read());
      while (!cam.available());
      if (8 < (n = cam.read())) continue;
      *(p = buf) = n;
      for (n*=5; n--;)
      {  while (!cam.available());
         *++p = cam.read();
      }
      while (!cam.available());
      if (0xFF == cam.read()) break;
   }
/*----------------------------------------------------------------------------*/

All three approaches attempt to sync on the 0x0A byte and verify that the correct number of bytes have actually been received by checking for the 0xFF delimiter, and will discard what they think are bad packets - but it's worth noting that the 0x0A/0xFF framing isn't completely reliable if those values can occur in the packet data.