Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-29 20:32:01 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-02 14:00:39 +0300
commitc112be25f7825d14b1c39ccbf325b85883f852c2 (patch)
treeea3489cf7fe076ed063cd7b3153facd99a2f4fd1 /libavformat/oggparsetheora.c
parent69ead86027d04e8f1dacd7b63eb936f62a8e0c6a (diff)
oggparsedaala: reject too large gpshift
Also use a unsigned constant for the shift calculation, as 1 << 31 is undefined for int32_t. This is also fixed oggparsetheora. This fixes ubsan runtime error: shift exponent is too large for 32-bit type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/oggparsetheora.c')
-rw-r--r--libavformat/oggparsetheora.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index 6e6a362e1e..5f057c3c8a 100644
--- a/libavformat/oggparsetheora.c
+++ b/libavformat/oggparsetheora.c
@@ -108,7 +108,7 @@ static int theora_header(AVFormatContext *s, int idx)
skip_bits(&gb, 2);
thp->gpshift = get_bits(&gb, 5);
- thp->gpmask = (1 << thp->gpshift) - 1;
+ thp->gpmask = (1U << thp->gpshift) - 1;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_THEORA;