forked from FFmpeg/FFmpeg
avutil/frame: fix remove_side_data
remove_side_data is supposed to remove a single instance by design. Since new_side_data() doesn't forbid add multiple instances of the same type, remove_side_data should deal with that. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
0e49560806
commit
20c5f4d835
2 changed files with 2 additions and 3 deletions
|
@ -806,7 +806,7 @@ void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < frame->nb_side_data; i++) {
|
||||
for (i = frame->nb_side_data - 1; i >= 0; i--) {
|
||||
AVFrameSideData *sd = frame->side_data[i];
|
||||
if (sd->type == type) {
|
||||
free_side_data(&frame->side_data[i]);
|
||||
|
|
|
@ -920,8 +920,7 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
|
|||
enum AVFrameSideDataType type);
|
||||
|
||||
/**
|
||||
* If side data of the supplied type exists in the frame, free it and remove it
|
||||
* from the frame.
|
||||
* Remove and free all side data instances of the given type.
|
||||
*/
|
||||
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue