[FFmpeg-cvslog] avformat/pcmdec: Fix NULL + 1

Andreas Rheinhardt git at videolan.org
Sun Feb 28 18:43:37 EET 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Wed Feb 24 02:08:32 2021 +0100| [b9b0c96db7aa272163c1e819553a3a508f029649] | committer: Andreas Rheinhardt

avformat/pcmdec: Fix NULL + 1

It is undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b9b0c96db7aa272163c1e819553a3a508f029649
---

 libavformat/pcmdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index e65b535665..395d9ecf92 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -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)



More information about the ffmpeg-cvslog mailing list