dvdsub_parse_extradata: fix memleak

Fixes CID1135765
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/51/head
Michael Niedermayer 11 years ago
parent f90281ca97
commit 7fa9f7ef1c
  1. 4
      libavcodec/dvdsubdec.c

@ -599,10 +599,12 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
int w, h; int w, h;
if (sscanf(data + 5, "%dx%d", &w, &h) == 2) { if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
int ret = ff_set_dimensions(avctx, w, h); int ret = ff_set_dimensions(avctx, w, h);
if (ret < 0) if (ret < 0) {
av_free(dataorig);
return ret; return ret;
} }
} }
}
data += pos; data += pos;
data += strspn(data, "\n\r"); data += strspn(data, "\n\r");

Loading…
Cancel
Save