[libav-commits] mov: log and return early on non-positive stsd entry counts
Module: libav Branch: release/11 Commit: 96af65b270392e4dfa81a6e62cc500b9252c0a2c Author:Sean McGovern Committer: Sean McGovern Date: Fri Jul 28 16:17:33 2017 -0400 mov: log and return early on non-positive stsd entry counts Based on an FFmpeg patch by Michael Niedermayer (cherry picked from commit d7bdab1ad78ef582ba8c96dc7b79ec9fdbeeb94f) Signed-off-by: Sean McGovern --- libavformat/mov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 5b5d1ca..c37a66f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1607,6 +1607,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); +if (entries <= 0) { +av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); +return AVERROR_INVALIDDATA; +} + return ff_mov_read_stsd_entries(c, pb, entries); } ___ libav-commits mailing list libav-commits@libav.org https://lists.libav.org/mailman/listinfo/libav-commits
[libav-commits] mov: log and return early on non-positive stsd entry counts
Module: libav Branch: release/12 Commit: 72fd8725a63c83fa5f2c85dba20e768c6a093ebc Author:Sean McGovern Committer: Sean McGovern Date: Fri Jul 28 16:17:33 2017 -0400 mov: log and return early on non-positive stsd entry counts Based on an FFmpeg patch by Michael Niedermayer (cherry picked from commit d7bdab1ad78ef582ba8c96dc7b79ec9fdbeeb94f) Signed-off-by: Sean McGovern --- libavformat/mov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 2ff5211..9f01aa5 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1902,6 +1902,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); +if (entries <= 0) { +av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); +return AVERROR_INVALIDDATA; +} + if (sc->extradata) { av_log(c->fc, AV_LOG_ERROR, "Duplicate stsd found in this track.\n"); ___ libav-commits mailing list libav-commits@libav.org https://lists.libav.org/mailman/listinfo/libav-commits
[libav-commits] mov: log and return early on non-positive stsd entry counts
Module: libav Branch: master Commit: d7bdab1ad78ef582ba8c96dc7b79ec9fdbeeb94f Author:Sean McGovern Committer: Sean McGovern Date: Fri Jul 28 16:17:33 2017 -0400 mov: log and return early on non-positive stsd entry counts Based on an FFmpeg patch by Michael Niedermayer --- libavformat/mov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index bf68fbd..8ff6022 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1875,6 +1875,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); +if (entries <= 0) { +av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); +return AVERROR_INVALIDDATA; +} + if (sc->extradata) { av_log(c->fc, AV_LOG_ERROR, "Duplicate stsd found in this track.\n"); ___ libav-commits mailing list libav-commits@libav.org https://lists.libav.org/mailman/listinfo/libav-commits