This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

error in examples for davinci media controller

 Hello,

there is an error in provided media controller examples


struct media_entity_desc entity[10];
...
/* 4.enumerate media-entities */

printf("4.enumerating media entities\n");
index = 0;
do {
   memset(&entity[index], 0, sizeof(entity));
   ...
   index++;

} while ...

This code can rewrite uninitialized memory. The solution is to do the memset before the cycle on whole entity array. It affects all files in mc subdirectory and it is also on the wiki.
Anyway, the quality of all code in examples is really poor, IMHO.

best regards
Jan