diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-14 23:55:39 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-15 16:50:55 +0100 |
commit | da857099e92fb7fede6d7b9e6b26879ce9c5a483 (patch) | |
tree | c76830ff9feea247ed4d9fa9e69787349b8c5e87 /libavformat/utils.c | |
parent | c0d0b1c4f6f804796488adf3e552be88c0cee1a4 (diff) | |
download | ffmpeg-da857099e92fb7fede6d7b9e6b26879ce9c5a483.tar.gz |
avformat/utils: Add av_assert1 to preclude NULL + len, len != 0
Such a scenario is undefined behaviour and would also indicate a bug
in our code.
Suggested-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index cea6d4ca92..652758e98e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1426,6 +1426,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, pkt->pts = pkt->dts = AV_NOPTS_VALUE; pkt->pos = -1; /* increment read pointer */ + av_assert1(data || !len); data = len ? data + len : data; size -= len; |