avcodec/tiff: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -838,7 +838,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
s->geotag_count = 0;
|
s->geotag_count = 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
s->geotags = av_mallocz(sizeof(TiffGeoTag) * s->geotag_count);
|
s->geotags = av_mallocz_array(s->geotag_count, sizeof(TiffGeoTag));
|
||||||
if (!s->geotags) {
|
if (!s->geotags) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
|
||||||
s->geotag_count = 0;
|
s->geotag_count = 0;
|
||||||
@@ -860,7 +860,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t))
|
if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int64_t))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
dp = av_malloc(count * sizeof(double));
|
dp = av_malloc_array(count, sizeof(double));
|
||||||
if (!dp) {
|
if (!dp) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
|
||||||
goto end;
|
goto end;
|
||||||
|
Reference in New Issue
Block a user