Skip to content

Commit

Permalink
avformat/utils: Add av_assert1 to preclude NULL + len, len != 0
Browse files Browse the repository at this point in the history
Such a scenario is undefined behaviour and would also indicate a bug
in our code.

Suggested-by: James Almer <[email protected]>
Reviewed-by: James Almer <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Feb 15, 2021
1 parent c0d0b1c commit da85709
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit da85709

Please sign in to comment.