avfilter/vf_lut3d: check size in parse_dat()

Fixes CID1212261
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/68/head
Michael Niedermayer 11 years ago
parent dc6b99d6b2
commit 2e55f3e907
  1. 7
      libavfilter/vf_lut3d.c

@ -274,7 +274,12 @@ static int parse_dat(AVFilterContext *ctx, FILE *f)
NEXT_LINE(skip_line(line));
if (!strncmp(line, "3DLUTSIZE ", 10)) {
lut3d->lutsize = size = strtol(line + 10, NULL, 0);
size = strtol(line + 10, NULL, 0);
if (size < 2 || size > MAX_LEVEL) {
av_log(ctx, AV_LOG_ERROR, "Too large or invalid 3D LUT size\n");
return AVERROR(EINVAL);
}
lut3d->lutsize = size;
NEXT_LINE(skip_line(line));
}
for (k = 0; k < size; k++) {

Loading…
Cancel
Save