Skip to content

Commit

Permalink
Bug 1846694: Additional validation in RecordedSourceSurfaceCreation. …
Browse files Browse the repository at this point in the history
…r=gfx-reviewers,jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D185354
  • Loading branch information
bradwerth committed Aug 10, 2023
1 parent 129c54f commit 967de2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gfx/2d/RecordedEventImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3206,6 +3206,13 @@ RecordedSourceSurfaceCreation::RecordedSourceSurfaceCreation(S& aStream)
ReadElement(aStream, mSize);
ReadElementConstrained(aStream, mFormat, SurfaceFormat::A8R8G8B8_UINT32,
SurfaceFormat::UNKNOWN);

if (!Factory::AllowedSurfaceSize(mSize)) {
gfxCriticalNote << "RecordedSourceSurfaceCreation read invalid size "
<< mSize;
aStream.SetIsBad();
}

if (!aStream.good()) {
return;
}
Expand Down

0 comments on commit 967de2e

Please sign in to comment.