diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-01 10:51:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-01 11:36:41 +0100 |
commit | 842745fe1705a6e7504aadd60c0d415ae35fe651 (patch) | |
tree | 302342a980085f2c5b1ab0a0fdf5e90f472dcf8f | |
parent | cc769931ab0ce8440cc3dd863b3d6a036ab9608b (diff) | |
download | ffmpeg-842745fe1705a6e7504aadd60c0d415ae35fe651.tar.gz |
avcodec/pthread_frame: Simplify code by using av_reallocp_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/pthread_frame.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index e4f92d9dfd..fa1c50a982 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -286,13 +286,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (src->slice_count && src->slice_offset) { if (dst->slice_count < src->slice_count) { - int *tmp = av_realloc(dst->slice_offset, src->slice_count * - sizeof(*dst->slice_offset)); - if (!tmp) { - av_free(dst->slice_offset); - return AVERROR(ENOMEM); - } - dst->slice_offset = tmp; + int err = av_reallocp_array(&dst->slice_offset, src->slice_count, + sizeof(*dst->slice_offset)); + if (err < 0) + return err; } memcpy(dst->slice_offset, src->slice_offset, src->slice_count * sizeof(*dst->slice_offset)); |