update libavcodec/tiff.c.

add patch

Signed-off-by: ziyugao <gaoziyu0614@outlook.com>
This commit is contained in:
ziyugao 2024-08-01 06:31:32 +00:00 committed by Gitee
parent c398641096
commit c9f61d3b85
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1267,9 +1267,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->is_thumbnail = (value != 0);
break;
case TIFF_WIDTH:
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->width = value;
break;
case TIFF_HEIGHT:
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->height = value;
break;
case TIFF_BPP:
@ -1401,12 +1405,18 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->tile_byte_counts_offset = off;
break;
case TIFF_TILE_LENGTH:
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->tile_length = value;
break;
case TIFF_TILE_WIDTH:
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->tile_width = value;
break;
case TIFF_PREDICTOR:
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->predictor = value;
break;
case TIFF_SUB_IFDS:
@ -1537,12 +1547,18 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
break;
case TIFF_T4OPTIONS:
if (s->compr == TIFF_G3)
if (s->compr == TIFF_G3) {
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->fax_opts = value;
}
break;
case TIFF_T6OPTIONS:
if (s->compr == TIFF_G4)
if (s->compr == TIFF_G4) {
if (value > INTMAX)
return AVERROR_INVALIDDATA;
s->fax_opts = value;
}
break;
#define ADD_METADATA(count, name, sep)\
if ((ret = add_metadata(count, type, name, sep, s, frame)) < 0) {\