avformat/pcmdec: Fix NULL + 1

It is undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2021-02-24 02:08:32 +01:00
parent 301ae25e99
commit b9b0c96db7

View File

@ -57,8 +57,9 @@ static int pcm_read_header(AVFormatContext *s)
len = strlen(mime_type);
while (options < mime_type + len) {
options = strstr(options, ";");
if (!options++)
if (!options)
break;
options++;
if (!rate)
sscanf(options, " rate=%d", &rate);
if (!channels)