Commit 46095f42 authored by Michael Niedermayer's avatar Michael Niedermayer

mp3dec: Check for memcpy size to be positive.

No, ive no testcase.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 10e9d1f7
...@@ -1385,6 +1385,7 @@ static int mp_decode_layer3(MPADecodeContext *s) ...@@ -1385,6 +1385,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
av_dlog(s->avctx, "seekback: %d\n", main_data_begin); av_dlog(s->avctx, "seekback: %d\n", main_data_begin);
//av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size); //av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
if (s->gb.size_in_bits > get_bits_count(&s->gb))
memcpy(s->last_buf + s->last_buf_size, ptr, memcpy(s->last_buf + s->last_buf_size, ptr,
FFMIN(EXTRABYTES, (s->gb.size_in_bits - get_bits_count(&s->gb))>>3)); FFMIN(EXTRABYTES, (s->gb.size_in_bits - get_bits_count(&s->gb))>>3));
s->in_gb = s->gb; s->in_gb = s->gb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment