1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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>
This commit is contained in:
Andreas Rheinhardt 2021-02-14 23:55:39 +01:00
parent c0d0b1c4f6
commit da857099e9

View File

@ -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;