the request made to the mtp library for the available tracks returns a linked list. a callback mechanism is additionally used for capturing the total track count.
problematically:
uint64_t
track count which was then stored in
an int
before being used by a calloc()
call to allocate enough
memory to store all of the corresponding items. the truncation may thus
mean that we do not allocate enough memory if faced with a huge count.int
based counter to wrap giving
undefined behaviour.VideoLAN code repository instance