You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avpacket: Fix error checking in packet_alloc
Conflicts:
libavcodec/avpacket.c
See: b905a7137a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -67,12 +67,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
|
|
||||||
static int packet_alloc(AVBufferRef **buf, int size)
|
static int packet_alloc(AVBufferRef **buf, int size)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
|
if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
|
ret = av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!*buf)
|
if (ret < 0)
|
||||||
return AVERROR(ENOMEM);
|
return ret;
|
||||||
|
|
||||||
memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user