[FFmpeg-cvslog] vorbisdec: Add missing checks
Luca Barbato
git at videolan.org
Mon Feb 25 12:57:10 CET 2013
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Feb 24 12:30:30 2013 +0100| [5b47c19bfda92273ae49e83db26a565afcaed80a] | committer: Luca Barbato
vorbisdec: Add missing checks
Rate and order must not be 0 even if the specification does not say that
explicitly.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b47c19bfda92273ae49e83db26a565afcaed80a
---
libavcodec/vorbisdec.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 9200ca0..7575ee4 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -584,7 +584,17 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
floor_setup->decode = vorbis_floor0_decode;
floor_setup->data.t0.order = get_bits(gb, 8);
+ if (!floor_setup->data.t0.order) {
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "Floor 0 order is 0.\n");
+ return AVERROR_INVALIDDATA;
+ }
floor_setup->data.t0.rate = get_bits(gb, 16);
+ if (!floor_setup->data.t0.rate) {
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "Floor 0 rate is 0.\n");
+ return AVERROR_INVALIDDATA;
+ }
floor_setup->data.t0.bark_map_size = get_bits(gb, 16);
if (!floor_setup->data.t0.bark_map_size) {
av_log(vc->avccontext, AV_LOG_ERROR,
More information about the ffmpeg-cvslog
mailing list