[FFmpeg-cvslog] vorbisdec: Check bark_map_size.

Michael Niedermayer git at videolan.org
Fri Mar 21 05:52:35 CET 2014


ffmpeg | branch: release/0.9 | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 11 00:54:12 2013 +0100| [3926ebc7029d97f2aa8c1d834a9a67d821c43db8] | committer: Michael Niedermayer

vorbisdec: Check bark_map_size.

This fixes potential divisions by zero and out of array accesses.

Reported-by: Dale Curtis <dalecurtis at chromium.org>
Found-by: inferno at chromium.org
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2c16bf2de07c68513072bf3cc96401d2c6291a3e)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3926ebc7029d97f2aa8c1d834a9a67d821c43db8
---

 libavcodec/vorbisdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 4bd1cf2..5e23580 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -595,6 +595,10 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
                        "Floor 0 amplitude bits is 0.\n");
                 return AVERROR_INVALIDDATA;
             }
+            if (floor_setup->data.t0.bark_map_size == 0) {
+                av_log(vc->avccontext, AV_LOG_ERROR, "Floor 0 bark map size is 0.\n");
+                return AVERROR_INVALIDDATA;
+            }
             floor_setup->data.t0.amplitude_offset = get_bits(gb, 8);
             floor_setup->data.t0.num_books        = get_bits(gb, 4) + 1;
 



More information about the ffmpeg-cvslog mailing list