mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/pthread_frame: Simplify code by using av_reallocp_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
cc769931ab
commit
842745fe17
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue