mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-11 08:13:06 +00:00
avcodec/bytestream2: don't allow using NULL pointers
This is UB. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -138,7 +138,7 @@ static av_always_inline void bytestream2_init(GetByteContext *g,
|
||||
const uint8_t *buf,
|
||||
int buf_size)
|
||||
{
|
||||
av_assert0(buf_size >= 0);
|
||||
av_assert0(buf && buf_size >= 0);
|
||||
g->buffer = buf;
|
||||
g->buffer_start = buf;
|
||||
g->buffer_end = buf + buf_size;
|
||||
@@ -148,7 +148,7 @@ static av_always_inline void bytestream2_init_writer(PutByteContext *p,
|
||||
uint8_t *buf,
|
||||
int buf_size)
|
||||
{
|
||||
av_assert0(buf_size >= 0);
|
||||
av_assert0(buf && buf_size >= 0);
|
||||
p->buffer = buf;
|
||||
p->buffer_start = buf;
|
||||
p->buffer_end = buf + buf_size;
|
||||
|
||||
Reference in New Issue
Block a user