mirror of https://git.ffmpeg.org/ffmpeg.git
avio: check AVIOContext malloc failure
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
7d4c4394b5
commit
9e2dabed4a
|
@ -113,6 +113,8 @@ AVIOContext *avio_alloc_context(
|
||||||
int64_t (*seek)(void *opaque, int64_t offset, int whence))
|
int64_t (*seek)(void *opaque, int64_t offset, int whence))
|
||||||
{
|
{
|
||||||
AVIOContext *s = av_mallocz(sizeof(AVIOContext));
|
AVIOContext *s = av_mallocz(sizeof(AVIOContext));
|
||||||
|
if (!s)
|
||||||
|
return NULL;
|
||||||
ffio_init_context(s, buffer, buffer_size, write_flag, opaque,
|
ffio_init_context(s, buffer, buffer_size, write_flag, opaque,
|
||||||
read_packet, write_packet, seek);
|
read_packet, write_packet, seek);
|
||||||
return s;
|
return s;
|
||||||
|
|
Loading…
Reference in New Issue