Browse Source

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>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
2e55f3e907
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavfilter/vf_lut3d.c

+ 6
- 1
libavfilter/vf_lut3d.c View File

@@ -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