mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avformat/matroskaenc: actually enforce the stream limit
Prevents out of array accesses. Adressess ticket #6873 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 9d464dc3fccb53f1e7c83e3453084c1a7fb90503)
This commit is contained in:
parent
5ab992cd38
commit
8d51090dcb
@ -1858,6 +1858,13 @@ static int mkv_write_header(AVFormatContext *s)
|
|||||||
av_dict_get(s->metadata, "alpha_mode", NULL, 0))
|
av_dict_get(s->metadata, "alpha_mode", NULL, 0))
|
||||||
version = 4;
|
version = 4;
|
||||||
|
|
||||||
|
if (s->nb_streams > MAX_TRACKS) {
|
||||||
|
av_log(s, AV_LOG_ERROR,
|
||||||
|
"At most %d streams are supported for muxing in Matroska\n",
|
||||||
|
MAX_TRACKS);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
if (s->streams[i]->codecpar->codec_id == AV_CODEC_ID_ATRAC3 ||
|
if (s->streams[i]->codecpar->codec_id == AV_CODEC_ID_ATRAC3 ||
|
||||||
s->streams[i]->codecpar->codec_id == AV_CODEC_ID_COOK ||
|
s->streams[i]->codecpar->codec_id == AV_CODEC_ID_COOK ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user