Browse Source

vp56: release frames on error

Fixes CVE-2012-2783

CC: libav-stable@libav.org

(cherry picked from commit f33b5ba63e)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
tags/n0.8.13
Luca Barbato Reinhard Tartler 13 years ago
parent
commit
7fd7950174
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      libavcodec/vp56.c

+ 7
- 1
libavcodec/vp56.c View File

@@ -511,8 +511,14 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
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;


Loading…
Cancel
Save