summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r--libavcodec/avpacket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 79123b186c..c0a0f8cd7b 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -64,12 +64,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
static int packet_alloc(AVBufferRef **buf, int size)
{
+ int ret;
if ((unsigned)size >= (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
return AVERROR(EINVAL);
- av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!buf)
- return AVERROR(ENOMEM);
+ ret = av_buffer_realloc(buf, size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (ret < 0)
+ return ret;
memset((*buf)->data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);