mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
avcodec/cbs: Remove redundant assignment
The code just creates new references without allocating new buffers for the subobjects; therefore the actual data pointer stays valid and need not be updated. Also remove an assert that ensured that the calculation for updating the pointer makes sense. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
33f33beead
commit
e35b8b848c
@ -955,17 +955,11 @@ static int cbs_clone_internal_refs_unit_content(AVBufferRef **clone_ref,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
// src_ptr is required to point somewhere inside src_buf. If it
|
|
||||||
// doesn't, there is a bug somewhere.
|
|
||||||
av_assert0(*src_ptr >= (*src_buf)->data &&
|
|
||||||
*src_ptr < (*src_buf)->data + (*src_buf)->size);
|
|
||||||
|
|
||||||
*copy_buf = av_buffer_ref(*src_buf);
|
*copy_buf = av_buffer_ref(*src_buf);
|
||||||
if (!*copy_buf) {
|
if (!*copy_buf) {
|
||||||
err = AVERROR(ENOMEM);
|
err = AVERROR(ENOMEM);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
*copy_ptr = (*copy_buf)->data + (*src_ptr - (*src_buf)->data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*clone_ref = av_buffer_create(copy, desc->content_size,
|
*clone_ref = av_buffer_create(copy, desc->content_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user