提交 1a2a1d90 编写于 作者: M Michael Niedermayer

Prevent segfault due to reading over the end of the input buffer.

Originally committed as revision 12315 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 79989881
......@@ -256,7 +256,10 @@ static inline void range_start_decoding(APEContext * ctx)
static inline void range_dec_normalize(APEContext * ctx)
{
while (ctx->rc.range <= BOTTOM_VALUE) {
ctx->rc.buffer = (ctx->rc.buffer << 8) | bytestream_get_byte(&ctx->ptr);
ctx->rc.buffer <<= 8;
if(ctx->ptr < ctx->data_end)
ctx->rc.buffer += *ctx->ptr;
ctx->ptr++;
ctx->rc.low = (ctx->rc.low << 8) | ((ctx->rc.buffer >> 1) & 0xFF);
ctx->rc.range <<= 8;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册