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>
(cherry picked from commit da857099e9)
This commit is contained in:
Andreas Rheinhardt 2021-02-14 23:55:39 +01:00
parent 3e8771e99e
commit 515aa63e4d

View File

@ -1472,6 +1472,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;