# HG changeset patch # User aurel # Date 1210283991 0 # Node ID c00f5cad61cc8a8c6a3965d0f27cb004670987d8 # Parent 33896780c612cb6f11f1bd031fd1a32d21566886 ensure vp56_decode_frame always return unchanged buf_size diff -r 33896780c612 -r c00f5cad61cc vp56.c --- a/vp56.c Thu May 08 21:11:24 2008 +0000 +++ b/vp56.c Thu May 08 21:59:51 2008 +0000 @@ -499,11 +499,12 @@ { vp56_context_t *s = avctx->priv_data; AVFrame *const p = s->framep[VP56_FRAME_CURRENT]; + int remaining_buf_size = buf_size; int is_alpha, alpha_offset; if (s->has_alpha) { alpha_offset = bytestream_get_be24(&buf); - buf_size -= 3; + remaining_buf_size -= 3; } for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) { @@ -514,7 +515,7 @@ s->modelp = &s->models[is_alpha]; - res = s->parse_header(s, buf, buf_size, &golden_frame); + res = s->parse_header(s, buf, remaining_buf_size, &golden_frame); if (!res) return -1; @@ -619,7 +620,7 @@ FFSWAP(AVFrame *, s->framep[VP56_FRAME_GOLDEN], s->framep[VP56_FRAME_GOLDEN2]); buf += alpha_offset; - buf_size -= alpha_offset; + remaining_buf_size -= alpha_offset; } }