diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-12-31 18:25:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-01 21:11:47 +0100 |
commit | 9520d51e21f9aa5adc807b0b89322bd822b06738 (patch) | |
tree | b210558f71ae45dc99fbdb825c20391e57340ea5 /libavcodec/avpacket.c | |
parent | 057328b29d749d03af9d205c6eec352621f5bc1c (diff) | |
download | ffmpeg-9520d51e21f9aa5adc807b0b89322bd822b06738.tar.gz |
avcodec/avpacket: Avoid unspecific return -1 for av_grow_packet()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r-- | libavcodec/avpacket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index e160ad3033..11ac4e80cd 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -112,7 +112,7 @@ int av_grow_packet(AVPacket *pkt, int grow_by) av_assert0((unsigned)pkt->size <= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE); if ((unsigned)grow_by > INT_MAX - (pkt->size + AV_INPUT_BUFFER_PADDING_SIZE)) - return -1; + return AVERROR(ENOMEM); new_size = pkt->size + grow_by + AV_INPUT_BUFFER_PADDING_SIZE; if (pkt->buf) { @@ -124,7 +124,7 @@ int av_grow_packet(AVPacket *pkt, int grow_by) } else { data_offset = pkt->data - pkt->buf->data; if (data_offset > INT_MAX - new_size) - return -1; + return AVERROR(ENOMEM); } if (new_size + data_offset > pkt->buf->size) { |