[vlc-commits] videotoolbox: fix crash if timestamps array is empty
Tobias Conradi
git at videolan.org
Sat Sep 12 00:27:34 CEST 2015
vlc | branch: master | Tobias Conradi <videolan at tobias-conradi.de> | Fri Sep 11 23:17:08 2015 +0200| [6cc21d0e5347a2f0703d1f194a2ef00e8535e8d1] | committer: Felix Paul Kühne
videotoolbox: fix crash if timestamps array is empty
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6cc21d0e5347a2f0703d1f194a2ef00e8535e8d1
---
modules/codec/videotoolbox.m | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 2af78d5..00124fb 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1027,8 +1027,11 @@ skip:
}
return (NSComparisonResult)NSOrderedSame;
}];
- timeStamp = [p_sys->outputTimeStamps firstObject];
- [p_sys->outputTimeStamps removeObjectAtIndex:0];
+ NSArray *timeStamps = p_sys->outputTimeStamps;
+ timeStamp = [timeStamps firstObject];
+ if (timeStamps.count>0) {
+ [timeStamps removeObjectAtIndex:0];
+ }
}
@synchronized(p_sys->outputFrames) {
More information about the vlc-commits
mailing list