]> git.sesse.net Git - ffmpeg/commit
avformat/utils: Fix undefined NULL + 0
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 14 Feb 2021 21:24:46 +0000 (22:24 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 14 Feb 2021 21:47:08 +0000 (22:47 +0100)
commit9c0b3eddf4262f9dcea479091f1307444e614e88
tree280eda6bb997a441a7576188b55b7bc6934f4576
parent4f49ca7bbc75a9db4cdf93f27f95a668c751f160
avformat/utils: Fix undefined NULL + 0

This is undefined behaviour in C, so use data = len ? data + len : data
instead of data += len. GCC optimizes the branch away in this case;
Clang unfortunately doesn't.

Fixes ticket #8592.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/utils.c