This makes av_stream_add_side_data() consistent with av_packet_add_side_data().
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
}
}
- tmp = av_realloc_array(st->side_data, st->nb_side_data + 1, sizeof(*tmp));
+ if ((unsigned)st->nb_side_data + 1 >= INT_MAX / sizeof(*st->side_data))
+ return AVERROR(ERANGE);
+
+ tmp = av_realloc(st->side_data, st->nb_side_data + 1 * sizeof(*tmp));
if (!tmp) {
return AVERROR(ENOMEM);
}