diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-16 15:36:24 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:56 +0100 |
commit | 75f811babc08af5eadf4f2ea23b3e5c46cadbe2a (patch) | |
tree | 176807b908dc940b50c6fc7e7c198cad14a6c9b8 | |
parent | 48f27c854f23b43890f72239c5d18b7fff0707af (diff) | |
download | ffmpeg-75f811babc08af5eadf4f2ea23b3e5c46cadbe2a.tar.gz |
matroskadec: Verify realaudio codec parameters
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 569d18aa9dc989c37bb4d4b968026fe5afa6fff9)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9f7a8b8f8f6ad024410232d926b774261ef2ef36)
-rw-r--r-- | libavformat/matroskadec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 03839f89fb..922b2580be 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1488,6 +1488,10 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) track->audio.sub_packet_h = avio_rb16(&b); track->audio.frame_size = avio_rb16(&b); track->audio.sub_packet_size = avio_rb16(&b); + if (flavor <= 0 || track->audio.coded_framesize <= 0 || + track->audio.sub_packet_h <= 0 || track->audio.frame_size <= 0 || + track->audio.sub_packet_size <= 0) + return AVERROR_INVALIDDATA; track->audio.buf = av_malloc(track->audio.frame_size * track->audio.sub_packet_h); if (codec_id == CODEC_ID_RA_288) { st->codec->block_align = track->audio.coded_framesize; |