Skip to content

Commit 6ba0b59

Browse files
committed
avcodec/bytestream2: don't allow using NULL pointers
This is UB. Signed-off-by: James Almer <[email protected]>
1 parent 2556db6 commit 6ba0b59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libavcodec/bytestream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static av_always_inline void bytestream2_init(GetByteContext *g,
138138
const uint8_t *buf,
139139
int buf_size)
140140
{
141-
av_assert0(buf_size >= 0);
141+
av_assert0(buf && buf_size >= 0);
142142
g->buffer = buf;
143143
g->buffer_start = buf;
144144
g->buffer_end = buf + buf_size;
@@ -148,7 +148,7 @@ static av_always_inline void bytestream2_init_writer(PutByteContext *p,
148148
uint8_t *buf,
149149
int buf_size)
150150
{
151-
av_assert0(buf_size >= 0);
151+
av_assert0(buf && buf_size >= 0);
152152
p->buffer = buf;
153153
p->buffer_start = buf;
154154
p->buffer_end = buf + buf_size;

0 commit comments

Comments
 (0)