Menu

#577 memset in v4l2 driver

Unstable
closed-accepted
Player (393)
5
2010-05-03
2010-03-29
Jayen Ashar
No

Not strictly a patch, but I noticed line 553 of playerstage > code > player > trunk > server > drivers > camera > v4l2 > camerav4l2.cc has:
memset(data, 0, sizeof data);
and i think it should be:
memset(data, 0, sizeof *data);

or, alternatively, use calloc on line 547.

--Jayen

http://playerstage.svn.sourceforge.net/viewvc/playerstage/code/player/trunk/server/drivers/camera/v4l2/camerav4l2.cc?revision=8408&view=markup

Discussion

  • Paul Osmialowski

    Oh, lol, it is, only four bytes are filled with 0. Should be: memset(data, 0, sizeof(player_camera_data_t));
    Fortunately, in following lines all relevant fields of player_camera_data_t structure are filled by correct values.

     
  • Paul Osmialowski

    Fixed in patch 2962489, thanks for pointing this!

     
  • Toby Collett

    Toby Collett - 2010-05-03

    The changes have been made in SVN trunk.
    Thank you for your contribution.

     
  • Toby Collett

    Toby Collett - 2010-05-03
    • status: open --> closed-accepted
     

Log in to post a comment.