From 3d035d5a6a9116a334fc82dcb37704da2d074958 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 23 Feb 2013 20:09:44 +0100 Subject: [PATCH 1/2] dsputil_alpha.h: Add missing stddef.h header to fix standalone compilation --- libavcodec/alpha/dsputil_alpha.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/alpha/dsputil_alpha.h b/libavcodec/alpha/dsputil_alpha.h index 6eee97fe63..fcea47c665 100644 --- a/libavcodec/alpha/dsputil_alpha.h +++ b/libavcodec/alpha/dsputil_alpha.h @@ -19,6 +19,7 @@ #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H +#include #include void ff_simple_idct_axp(int16_t *block); From 11dcecfcca0eca1a571792c4fa3c21fb2cfddddc Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 11 Jan 2013 00:54:12 +0100 Subject: [PATCH 2/2] vorbisdec: Error on bark_map_size equal to 0. The value is used to calculate output LSP curve and a division by zero and out of array accesses would occur. CVE-2013-0894 CC: libav-stable@libav.org Reported-by: Dale Curtis Found-by: inferno@chromium.org Signed-off-by: Michael Niedermayer Signed-off-by: Luca Barbato --- libavcodec/vorbisdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 158bd6f57c..600083bd59 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -586,6 +586,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) floor_setup->data.t0.order = get_bits(gb, 8); floor_setup->data.t0.rate = get_bits(gb, 16); floor_setup->data.t0.bark_map_size = get_bits(gb, 16); + 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_bits = get_bits(gb, 6); /* zero would result in a div by zero later * * 2^0 - 1 == 0 */