From 512beea52936f5935a0c6cdaef18364520ea5b7c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 18 Sep 2012 17:33:55 +0200 Subject: [PATCH] sonicenc: limit quant so that golomb codes are less than 32 bits long before they could become 33 bits Signed-off-by: Michael Niedermayer --- libavcodec/sonic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index acd7412d9b..d412d60391 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -724,8 +724,8 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if (quant < 1) quant = 1; - if (quant > 65535) - quant = 65535; + if (quant > 65534) + quant = 65534; set_ue_golomb(&pb, quant);