PHLivePhotoView crash when requesting PHLivePhoto with non-existing files

Originator:milen
Number:rdar://24021574 Date Originated:29-Dec-2015 06:12 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 9.1 (13B143), iOS 9.2 (13C75)
Classification:Crasher Reproducible:Always
 
Summary:
PHLivePhotoView references a deallocated object when trying to display a requested PHLivePhoto from non-existing files.

Steps to Reproduce:
1. Run attached project
2. Press "Load Live Photo" project

Expected Results:
App does not crash.

Actual Results:
PHLivePhotoView bug causes crash.

Log with zombies enabled: // 2015-12-29 18:01:59.600 Live-Photo-View-Crash[11421:694511] *** -[ISPlayerItem unregisterObserver:]: message sent to deallocated instance 0x7ff4c3e176d0

Version:
iOS 9.1 (13B143), iOS 9.2 (13C75)

Notes:


Configuration:
iPhone 6, iOS Simulator

Attachments:
'Live-Photo-View-Crash.zip' was successfully uploaded.

- (IBAction)loadLivePhoto:(id)sender {
  NSArray<NSURL *> *urls = @[
    [NSURL fileURLWithPath:@"/some/non-existing/file.jpeg"],
    [NSURL fileURLWithPath:@"/some/non-existing/movie.mov"],
  ];
  
  [PHLivePhoto
    requestLivePhotoWithResourceFileURLs:urls
    placeholderImage:nil
    targetSize:CGSizeZero
    contentMode:PHImageContentModeDefault
    resultHandler:^(PHLivePhoto * _Nullable livePhoto, NSDictionary * _Nonnull info) {
//      if (livePhoto != nil && CGSizeEqualToSize(livePhoto.size, CGSizeZero)) {
//        // crasher workaround
//        return;
//      }
      
      self.liveView.livePhoto = livePhoto;
  }];
}

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!