Commit 842745fe authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pthread_frame: Simplify code by using av_reallocp_array()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent cc769931
......@@ -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 *
int err = av_reallocp_array(&dst->slice_offset, src->slice_count,
sizeof(*dst->slice_offset));
if (!tmp) {
av_free(dst->slice_offset);
return AVERROR(ENOMEM);
}
dst->slice_offset = tmp;
if (err < 0)
return err;
}
memcpy(dst->slice_offset, src->slice_offset,
src->slice_count * sizeof(*dst->slice_offset));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment