Browse Source

dvdsubdec: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1198262
tags/n2.5
Luca Barbato Vittorio Giovara 11 years ago
parent
commit
d466d82faa
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      libavcodec/dvdsubdec.c

+ 6
- 3
libavcodec/dvdsubdec.c View File

@@ -503,6 +503,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
{
DVDSubContext *ctx = avctx->priv_data;
char *data, *cur;
int ret = 0;

if (!avctx->extradata || !avctx->extradata_size)
return 0;
@@ -527,16 +528,18 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
} else if (!strncmp("size:", cur, 5)) {
int w, h;
if (sscanf(cur + 5, "%dx%d", &w, &h) == 2) {
int ret = ff_set_dimensions(avctx, w, h);
ret = ff_set_dimensions(avctx, w, h);
if (ret < 0)
return ret;
goto fail;
}
}
cur += strcspn(cur, "\n\r");
cur += strspn(cur, "\n\r");
}

fail:
av_free(data);
return 0;
return ret;
}

AVCodec ff_dvdsub_decoder = {


Loading…
Cancel
Save