Infinite loop at demuxer vlc 2.1.5
We use libvlc 2.1.5 in our program for audio streaming. But sometimes our application hangs and produces a lot of connect/close winapi calls, after few minutes Windows becomes not usable for internet surfing, every connection fails with error. Problem sometimes happens if we call libvlc_media_player_stop right after libvlc_media_player_play.
Further investigation shows that vlc hangs at demux.c Run -> Init -> InputSourceInit -> demux_New -> while(SkipID3Tag()). Problem reproducable in windows and linux.
So this is full explanation for a bug:
If we call libvlc_media_player_stop right after libvlc_media_player_play input thread can freeze at Run -> Init -> InputSourceInit -> demux_New -> while(SkipID3Tag()). In SkipID3Tag if we start reading data we can't stop read until we read id3 tag completely, but if access object has been deleted at libvlc_media_player_stop while we are receiving data for id3 tag, SkipID3Tag will cause infintie loop.
Little patch for this case was written and succesfully tested, see attachments.