Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PyAV
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyAV
  • PyAV
  • Merge requests
  • !981

Fix useful_array when unaligned and dtype > 1 byte

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/corco/fix-useful-array-align into main May 09, 2022
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: corco

This fix the function useful_array when unaligned and dtype's size is 2 or more bytes. See the added test that fails with previous' function.

The issue is that the current fonction crops the numpy array using sizes in bytes instead of in number of array elements. When dtype is not a byte, the wrong cropping occurs.

There are several way to fix the function, such as expressing total_line_size and useful_line_size in number of elements instead of bytes. I choose to crop the numpy array in bytes before reinterpreting it in dtype.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/corco/fix-useful-array-align