Skip to content

Commit

Permalink
Fix sizeof call in memset (AOMediaCodec#2379)
Browse files Browse the repository at this point in the history
Fix sizeof call in memset
Rename avifGainMapMetadataSetDefaults to avifGainMapMetadataDoubleSetDefaults
  • Loading branch information
maryla-uc authored Aug 9, 2024
1 parent 0c33338 commit 58acc88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gainmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ avifBool avifGainMapMetadataFractionsToDouble(avifGainMapMetadataDouble * dst, c
return AVIF_TRUE;
}

static void avifGainMapMetadataSetDefaults(avifGainMapMetadataDouble * metadata)
static void avifGainMapMetadataDoubleSetDefaults(avifGainMapMetadataDouble * metadata)
{
memset(metadata, 0, sizeof(avifGainMapMetadata));
memset(metadata, 0, sizeof(*metadata));
for (int i = 0; i < 3; ++i) {
metadata->baseOffset[i] = 0.015625; // 1/64
metadata->alternateOffset[i] = 0.015625; // 1/64
Expand Down Expand Up @@ -541,7 +541,7 @@ avifResult avifRGBImageComputeGainMap(const avifRGBImage * baseRgbImage,
}

avifGainMapMetadataDouble gainMapMetadata;
avifGainMapMetadataSetDefaults(&gainMapMetadata);
avifGainMapMetadataDoubleSetDefaults(&gainMapMetadata);
gainMapMetadata.useBaseColorSpace = (gainMapMathPrimaries == baseColorPrimaries);

float (*baseGammaToLinear)(float) = avifTransferCharacteristicsGetGammaToLinearFunction(baseTransferCharacteristics);
Expand Down

0 comments on commit 58acc88

Please sign in to comment.