Commit 080acf77 authored by Vignesh Venkatasubramanian's avatar Vignesh Venkatasubramanian Committed by Michael Niedermayer

lavf/matroskadec: Ensure cues_end is initialized

Ensure that cues_start and cues_end are always initialized and
the webm_dash_manifest_cues function returns appropriate error if
they are not computed correctly.

This fixes coverity defect CID1231991.
Signed-off-by: 's avatarVignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bb298967
......@@ -3321,7 +3321,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s)
EbmlList *seekhead_list = &matroska->seekhead;
MatroskaSeekhead *seekhead = seekhead_list->elem;
char *buf;
int64_t cues_start, cues_end, before_pos, bandwidth;
int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth;
int i;
// determine cues start and end positions
......@@ -3340,6 +3340,7 @@ static int webm_dash_manifest_cues(AVFormatContext *s)
cues_end = cues_start + cues_length + 11; // 11 is the offset of Cues ID.
}
avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
if (cues_start == -1 || cues_end == -1) return -1;
// parse the cues
matroska_parse_cues(matroska);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment