Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • OpenGL
  • libGLESv2
  • Context.h
Find file
BlameHistoryPermalink
  • Nicolas Capens's avatar
    Fix integer overflow in image size calculation · 5be09849
    Nicolas Capens authored Oct 02, 2019
    GLsizei is historically defined as a 32-bit signed integer, which is
    not allowed to be negative. But doing arithmetic with them can lead to
    overflows producing undefined values, including negative ones.
    
    Use size_t instead for these image data size calculations. It's defined
    as an unsigned integer large enough to fit valid memory buffer sizes.
    In practice that's 32-bit on 32-bit platforms, and 64-bit on 64-bit
    ones, which is large enough to avoid overflow in the OutOfMemory test.
    
    Bug: b/140421004
    Change-Id: Id05dd64d470f579455fdc9925b0ab303ecaf37fb
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36968Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
    5be09849
Context.h 26.4 KB
EditWeb IDE
×

Replace Context.h

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.