Skip to content

Commit

Permalink
vp56: release frames on error
Browse files Browse the repository at this point in the history
Fixes CVE-2012-2783

CC: libav-stable@libav.org
  • Loading branch information
lu-zero committed Dec 14, 2012
1 parent bb675d3 commit f33b5ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libavcodec/vp56.c
Expand Up @@ -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;
Expand Down

0 comments on commit f33b5ba

Please sign in to comment.