aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-12-14 09:55:04 +0100
committerLuca Barbato <lu_zero@gentoo.org>2012-12-14 13:21:59 +0100
commitf33b5ba63eee96c9d1c7f0e568169cb0c3694238 (patch)
tree1f6b5b94af40f2269c5c04ed95acbdd03fd83bd8 /libavcodec
parentbb675d3ac6d722d5e117ae9042a996b55ca05b1d (diff)
downloadffmpeg-f33b5ba63eee96c9d1c7f0e568169cb0c3694238.tar.gz
vp56: release frames on error
Fixes CVE-2012-2783 CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp56.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 6779ffb6dc..5bd0a1abef 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -514,8 +514,14 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->modelp = &s->models[is_alpha];
res = s->parse_header(s, buf, remaining_buf_size, &golden_frame);
- if (res < 0)
+ if (res < 0) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ if (s->frames[i].data[0])
+ avctx->release_buffer(avctx, &s->frames[i]);
+ }
return res;
+ }
if (res == VP56_SIZE_CHANGE) {
int i;