diff options
author | Vignesh Venkatasubramanian <vigneshv@google.com> | 2014-08-25 09:15:13 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-25 18:25:39 +0200 |
commit | 080acf7771e1ca7ab1b20a3c8f20f0ef1150e285 (patch) | |
tree | 45bb5c77f5d740eae72a651a2c7373f0ffb5ca25 | |
parent | bb29896793bfa1f23066b0d3fb5353ecd741ce0c (diff) | |
download | ffmpeg-080acf7771e1ca7ab1b20a3c8f20f0ef1150e285.tar.gz |
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: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/matroskadec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index c19e8e9ca8..83c1b3dbe0 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -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); |