aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-05-08 21:59:51 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-05-08 21:59:51 +0000
commit5210529e2d101a54f9710361352719e919374a10 (patch)
tree7649ad409c25225e0c8c4b1a9d0e154d5d6be46e
parent53a1e82bd25f926679a165a6c632ccc799fddb3c (diff)
downloadffmpeg-5210529e2d101a54f9710361352719e919374a10.tar.gz
ensure vp56_decode_frame always return unchanged buf_size
Originally committed as revision 13083 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/vp56.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 35cce07be6..559d4a3468 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -499,11 +499,12 @@ int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
{
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 @@ int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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 @@ int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
FFSWAP(AVFrame *, s->framep[VP56_FRAME_GOLDEN],
s->framep[VP56_FRAME_GOLDEN2]);
buf += alpha_offset;
- buf_size -= alpha_offset;
+ remaining_buf_size -= alpha_offset;
}
}