diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-16 14:21:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-16 14:22:26 +0200 |
commit | 7283d2bb90ab0b885ab2a53219123be3bca08010 (patch) | |
tree | 93843835d1113f28488ef654c043537764147de6 /libavcodec | |
parent | b3970b39491ffab25a9c922f384855aca81d50b2 (diff) | |
parent | 85e8192b8593816c0445411a5bef5fc5363a9b6d (diff) | |
download | ffmpeg-7283d2bb90ab0b885ab2a53219123be3bca08010.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avpacket: Fix error checking in packet_alloc
Conflicts:
libavcodec/avpacket.c
See: b905a7137a51a9a4f66d75172897d1f38c0b292a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avpacket.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index b388d5e7bd..bee159d01d 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -67,12 +67,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); |