-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix potential crash in ChunkedFile #38
Merged
andrewjl-mux
merged 1 commit into
releases/v0.4.0
from
ajlb/fix-potential-crash-in-chunked-file
Jun 15, 2023
Merged
Fix potential crash in ChunkedFile #38
andrewjl-mux
merged 1 commit into
releases/v0.4.0
from
ajlb/fix-potential-crash-in-chunked-file
Jun 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daytime-em
approved these changes
Jun 15, 2023
andrewjl-mux
added a commit
that referenced
this pull request
Jul 19, 2023
Convert forced type cast to a conditional type cast and throw error when the latter fails
cjpillsbury
pushed a commit
that referenced
this pull request
Jul 20, 2023
Convert forced type cast to a conditional type cast and throw error when the latter fails
andrewjl-mux
added a commit
that referenced
this pull request
Jul 20, 2023
Convert forced type cast to a conditional type cast and throw error when the latter fails
Merged
andrewjl-mux
added a commit
that referenced
this pull request
Jul 20, 2023
Convert forced type cast to a conditional type cast and throw error when the latter fails
andrewjl-mux
added a commit
that referenced
this pull request
Jul 21, 2023
* Project Input standardization (#17) (#41) (#46) (#48) (#57) (#77) Add AVFoundation and PhotosKit initializers Add internal and external state mapping Remove duplicate status enum and add inline docs to external status Add inline API docs to PHAsset-based MuxUpload constructor Consolidate all `MuxUpload` options into a single struct `UploadOptions` Declare asynchronous MuxUpload constructor in PHAsset extension Place extension methods into dedicated directories Polish inline API documentation Add new API documentation and note the placeholder implementation Add option variants as static members: defaults, disabled inputStandardization Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date. Store all MuxUpload-related options in UploadInfo Use correct starting byte parameter when restarting upload If input standardized, standardized input URL is passed to UploadInfo instead of the original input URL used for initializer Note: SDK probably needs to re-export a high quality asset anyway so possibly need a bridging status Add dedicated internal initializer for MuxUpload error with unknown error code Request local and remote assets Standardize via AVFoundation asset export session Expose hook for client to cancel upload if standardization failed Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe and confirm Export based on maximum resolution set by client Cleaner non standard input handler invocation Add CustomStringConvertible conformance to maximum resolution (#56) Only mark upload as started if its ready Safe storage for MuxUpload (#71) Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols Switch order of operations to avoid long pause on fetching duration AVAsset sometimes hangs when asked to asynchronously fetch duration when there aren't audio or video tracks present. To avoid this after starting the upload, the inspection step will get the video tracks first and get the duration afterwards. --------- Co-authored-by: Emily Dixon <edixon@mux.com> * Minor example app renaming (#29) * Use a UUID string as MuxUpload internal identifier (#30) * Display a more specific error message when the direct upload POST request fails (#32) * Use MuxUpload id instead if the input URL when looking up or writing state in the SDK (#33) * Change upload creation example app method to use discardableResult (#34) * Add dedicated internal initializer for MuxUpload error with unknown error code (#35) * Rename enum and adjust to camel casing (#36) * Adhere to Swift formatting guidelines, remove snake casing (#37) * Fix potential crash in ChunkedFile (#38) * Include Cloud shared asset sources when requesting assets (#40) * Prevent arithmentic overflow when setting chunk content range value (#45) * Remove force unwrap that can cause a crash (#47) * Make internal class methods internal (#51)
tomkordic
pushed a commit
that referenced
this pull request
Mar 1, 2024
* Project Input standardization (#17) (#41) (#46) (#48) (#57) (#77) Add AVFoundation and PhotosKit initializers Add internal and external state mapping Remove duplicate status enum and add inline docs to external status Add inline API docs to PHAsset-based MuxUpload constructor Consolidate all `MuxUpload` options into a single struct `UploadOptions` Declare asynchronous MuxUpload constructor in PHAsset extension Place extension methods into dedicated directories Polish inline API documentation Add new API documentation and note the placeholder implementation Add option variants as static members: defaults, disabled inputStandardization Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date. Store all MuxUpload-related options in UploadInfo Use correct starting byte parameter when restarting upload If input standardized, standardized input URL is passed to UploadInfo instead of the original input URL used for initializer Note: SDK probably needs to re-export a high quality asset anyway so possibly need a bridging status Add dedicated internal initializer for MuxUpload error with unknown error code Request local and remote assets Standardize via AVFoundation asset export session Expose hook for client to cancel upload if standardization failed Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe and confirm Export based on maximum resolution set by client Cleaner non standard input handler invocation Add CustomStringConvertible conformance to maximum resolution (#56) Only mark upload as started if its ready Safe storage for MuxUpload (#71) Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols Switch order of operations to avoid long pause on fetching duration AVAsset sometimes hangs when asked to asynchronously fetch duration when there aren't audio or video tracks present. To avoid this after starting the upload, the inspection step will get the video tracks first and get the duration afterwards. --------- Co-authored-by: Emily Dixon <edixon@mux.com> * Minor example app renaming (#29) * Use a UUID string as MuxUpload internal identifier (#30) * Display a more specific error message when the direct upload POST request fails (#32) * Use MuxUpload id instead if the input URL when looking up or writing state in the SDK (#33) * Change upload creation example app method to use discardableResult (#34) * Add dedicated internal initializer for MuxUpload error with unknown error code (#35) * Rename enum and adjust to camel casing (#36) * Adhere to Swift formatting guidelines, remove snake casing (#37) * Fix potential crash in ChunkedFile (#38) * Include Cloud shared asset sources when requesting assets (#40) * Prevent arithmentic overflow when setting chunk content range value (#45) * Remove force unwrap that can cause a crash (#47) * Make internal class methods internal (#51)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Force casting to a type using
as!
terminates the process instead of throwing an error on failure. Change to conditional castas?
and throw an error if that fails.