]> git.sesse.net Git - ffmpeg/commit
avformat/webmdashenc: Remove possibility of infinite loop
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 18 May 2020 02:19:32 +0000 (04:19 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 23 May 2020 04:29:53 +0000 (06:29 +0200)
commit9b614826275e346ac17b9bc7ef5a58dded5b1855
tree7f8c39569a257d6032cfd09fa1f84a503656e543
parent1030993db212667d64cd0234c2ef1fccd30f0c1f
avformat/webmdashenc: Remove possibility of infinite loop

The WebM DASH manifest muxer uses a loop to parse the adaptation_sets
string (which is given by the user and governs which AVStreams are
mapped to what adaptation set) and the very beginning of this loop is
"if (*p == ' ') continue;". This of course leads to an infinite loop if
the condition is true. It is true if e.g. the string begins with ' ' or
if there are more than one ' ' between different adaptation set groups.

To fix this, the parsing process has been modified to consume the space
if it is at a place where it can legitimately occur, i.e. when a new
adaptation set group is expected. The latter restriction implies that an
error is returned if a space exists where none is allowed to exist.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/webmdashenc.c