aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Goulet <mgoulet@fb.com>2022-06-16 17:52:56 +0200
committerThilo Borgmann <thilo.borgmann@mail.de>2022-06-20 11:08:26 +0200
commit0aa5dd084b8e26c9d644354c42c9252cf3b19cea (patch)
tree085bd1100f9aef81cdc9c2eb3460fcd8d4615e81
parent6c3a82f0433de8ff9c35def971a736056cc8ff38 (diff)
downloadffmpeg-0aa5dd084b8e26c9d644354c42c9252cf3b19cea.tar.gz
lavc/libx264.c: Fix possible UB by NULL pointer LHS
It is UB to attempt to do pointer arithmetic on NULL pointer LHS, even if that pointer arithmetic ends up being "+= 0" (i.e. !!p == 0 if p == NULL).
-rw-r--r--libavcodec/libx264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 14177b3016..616d855067 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -940,7 +940,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
return ret;
}
p= strchr(p, ':');
- p+=!!p;
+ if (p) {
+ ++p;
+ }
}
}