aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-02 05:02:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-02 05:13:29 +0100
commitf5d1d1e4667ba346ea7e0f97e6d2756bc9d4abde (patch)
treebcf708a0e9a22fd2564661e71bb79e51dc789a7e
parent52a213865670ae69c1852d4d04cf41f8929abbd0 (diff)
downloadffmpeg-f5d1d1e4667ba346ea7e0f97e6d2756bc9d4abde.tar.gz
avformat/oggparsevorbis: check packet size before reading new_len from it
Fixes out of array read Fixes: 34260c7981118fb38fba61809bf4dd5a-asan_heap-oob_93b923_1508_cov_951051643_DivX640x480_oggvorbis.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/oggparsevorbis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 2739123389..3f0797bc22 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -347,7 +347,7 @@ static int vorbis_header(AVFormatContext *s, int idx)
avpriv_set_pts_info(st, 64, 1, srate);
}
} else if (os->buf[os->pstart] == 3) {
- if (vorbis_update_metadata(s, idx) >= 0) {
+ if (vorbis_update_metadata(s, idx) >= 0 && priv->len[1] > 10) {
// drop all metadata we parsed and which is not required by libvorbis
unsigned new_len = 7 + 4 + AV_RL32(priv->packet[1] + 7) + 4 + 1;
if (new_len >= 16 && new_len < os->psize) {