Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard avifDiagnosticsClearError() in avif.c #1492

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/avif.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ avifBool avifCropRectConvertCleanApertureBox(avifCropRect * cropRect,
avifPixelFormat yuvFormat,
avifDiagnostics * diag)
{
avifDiagnosticsClearError(diag);
if (diag) {
avifDiagnosticsClearError(diag);
}
wantehchang marked this conversation as resolved.
Show resolved Hide resolved

// ISO/IEC 14496-12:2020, Section 12.1.4.1:
// For horizOff and vertOff, D shall be strictly positive and N may be
Expand Down Expand Up @@ -772,7 +774,9 @@ avifBool avifCleanApertureBoxConvertCropRect(avifCleanApertureBox * clap,
avifPixelFormat yuvFormat,
avifDiagnostics * diag)
{
avifDiagnosticsClearError(diag);
if (diag) {
avifDiagnosticsClearError(diag);
}

if (!avifCropRectIsValid(cropRect, imageW, imageH, yuvFormat, diag)) {
return AVIF_FALSE;
Expand Down