There are no guards on this line of code. If fx_media_opened_file_count happens to be 0, it will become -1 (0xFFFF FFFF)
|
media_ptr -> fx_media_opened_file_count--; |
In many functions, we have this common sequence of code below. When fx_media_opened_file_count is -1, the while loop will run indefinitely and the processor gets stuck, resulting in watchdog reset.
/* Loop through the media's open files. */
open_count = media_ptr -> fx_media_opened_file_count;
file_ptr = media_ptr -> fx_media_opened_file_list;
while (open_count)