diff mbox series

[FFmpeg-devel,06/15] avformat/pcmdec: Fix NULL + 1

Message ID 20210224115341.794293-6-andreas.rheinhardt@gmail.com
State Accepted
Commit b9b0c96db7aa272163c1e819553a3a508f029649
Headers show
Series [FFmpeg-devel,01/15] avformat/movenc: Remove always true check | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Feb. 24, 2021, 11:53 a.m. UTC
It is undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/pcmdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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)