mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
matroskadec: check that pointers were initialized before accessing them
fix ticket #14 Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
This commit is contained in:
parent
2a0d4d4cd0
commit
2851b1f656
@ -1085,19 +1085,21 @@ static void matroska_convert_tags(AVFormatContext *s)
|
||||
if (tags[i].target.attachuid) {
|
||||
MatroskaAttachement *attachment = matroska->attachments.elem;
|
||||
for (j=0; j<matroska->attachments.nb_elem; j++)
|
||||
if (attachment[j].uid == tags[i].target.attachuid)
|
||||
if (attachment[j].uid == tags[i].target.attachuid
|
||||
&& attachment[j].stream)
|
||||
matroska_convert_tag(s, &tags[i].tag,
|
||||
&attachment[j].stream->metadata, NULL);
|
||||
} else if (tags[i].target.chapteruid) {
|
||||
MatroskaChapter *chapter = matroska->chapters.elem;
|
||||
for (j=0; j<matroska->chapters.nb_elem; j++)
|
||||
if (chapter[j].uid == tags[i].target.chapteruid)
|
||||
if (chapter[j].uid == tags[i].target.chapteruid
|
||||
&& chapter[j].chapter)
|
||||
matroska_convert_tag(s, &tags[i].tag,
|
||||
&chapter[j].chapter->metadata, NULL);
|
||||
} else if (tags[i].target.trackuid) {
|
||||
MatroskaTrack *track = matroska->tracks.elem;
|
||||
for (j=0; j<matroska->tracks.nb_elem; j++)
|
||||
if (track[j].uid == tags[i].target.trackuid)
|
||||
if (track[j].uid == tags[i].target.trackuid && track[j].stream)
|
||||
matroska_convert_tag(s, &tags[i].tag,
|
||||
&track[j].stream->metadata, NULL);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user