From dbb759bbd8b6bd765694b4e23ee84273d6cbee63 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Wed, 31 Aug 2016 15:02:45 +0200 Subject: [PATCH] Fix a crash in copySubtitleSample. --- MP42/MP42Fifo.m | 4 ++-- MP42/MP42SubUtilities.h | 4 ++-- MP42/MP42Track.m | 9 --------- MP42Foundation.xcodeproj/project.pbxproj | 4 ++-- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/MP42/MP42Fifo.m b/MP42/MP42Fifo.m index 9bcf30d..9ec310a 100644 --- a/MP42/MP42Fifo.m +++ b/MP42/MP42Fifo.m @@ -58,7 +58,7 @@ dispatch_semaphore_signal(_empty); } -- (nullable id)dequeue { +- (nullable id)dequeue NS_RETURNS_RETAINED { if (!_count) return nil; id item = _array[_head++]; @@ -73,7 +73,7 @@ return item; } -- (nullable id)dequeueAndWait { +- (nullable id)dequeueAndWait NS_RETURNS_RETAINED { id item = [self dequeue]; while (!item) { diff --git a/MP42/MP42SubUtilities.h b/MP42/MP42SubUtilities.h index dcccda2..33b1530 100644 --- a/MP42/MP42SubUtilities.h +++ b/MP42/MP42SubUtilities.h @@ -61,8 +61,8 @@ unsigned ParseSubTime(const char *time, unsigned secondScale, BOOL hasSign); @class MP42SampleBuffer; -MP42SampleBuffer * copySubtitleSample(MP4TrackId subtitleTrackId, NSString *string, MP4Duration duration, BOOL forced, BOOL verticalPlacement, BOOL styles, CGSize trackSize, int top); -MP42SampleBuffer * copyEmptySubtitleSample(MP4TrackId subtitleTrackId, MP4Duration duration, BOOL forced); +MP42SampleBuffer * copySubtitleSample(MP4TrackId subtitleTrackId, NSString *string, MP4Duration duration, BOOL forced, BOOL verticalPlacement, BOOL styles, CGSize trackSize, int top) NS_RETURNS_RETAINED; +MP42SampleBuffer * copyEmptySubtitleSample(MP4TrackId subtitleTrackId, MP4Duration duration, BOOL forced) NS_RETURNS_RETAINED; typedef struct { // color format is 32-bit ARGB diff --git a/MP42/MP42Track.m b/MP42/MP42Track.m index ef09adf..211e12e 100644 --- a/MP42/MP42Track.m +++ b/MP42/MP42Track.m @@ -257,15 +257,6 @@ return StringFromTime(_duration, 1000); } -@synthesize sourceURL = _sourceURL; -@synthesize trackId = _trackId; -@synthesize sourceId = _sourceId; - -@synthesize format = _format; -@synthesize sourceFormat = _sourceFormat; -@synthesize name = _name; -@synthesize extendedLanguageTag = _extendedLanguageTag; - - (NSString *)name { if (_name == nil) { _name = [[self defaultName] copy]; diff --git a/MP42Foundation.xcodeproj/project.pbxproj b/MP42Foundation.xcodeproj/project.pbxproj index 0b73f95..55a3630 100644 --- a/MP42Foundation.xcodeproj/project.pbxproj +++ b/MP42Foundation.xcodeproj/project.pbxproj @@ -1031,11 +1031,12 @@ A9B9C27A1823923200416A4E /* MP42Fifo.m in Sources */, A9DFBDA3195FF5BA00410060 /* MP42Heap.m in Sources */, A9B9C2801823923200416A4E /* MP42H264Importer.mm in Sources */, - A9B9C26B1823923200416A4E /* MP42AudioConverter.m in Sources */, A9022A961D6F3FD9005F0920 /* MP42MetadataItem.m in Sources */, A9B9C2D0182396A100416A4E /* MP42Ratings.m in Sources */, A9B9C2AB1823923200416A4E /* mbs.cpp in Sources */, A9B9C2AE1823923200416A4E /* sfifo.c in Sources */, + A9B9C26B1823923200416A4E /* MP42AudioConverter.m in Sources */, + A9B9C2711823923200416A4E /* MP42BitmapSubConverter.m in Sources */, A9B9C28E1823923200416A4E /* MP42Muxer.m in Sources */, A991714C195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */, A9B9C27C1823923200416A4E /* MP42File.m in Sources */, @@ -1068,7 +1069,6 @@ A9B9C29A1823923200416A4E /* MP42SubUtilities.m in Sources */, A90801131D4B83A3002B6950 /* MP42AudioDecoder.m in Sources */, A9422FC51D4917AF000DB435 /* audio_resample.c in Sources */, - A9B9C2711823923200416A4E /* MP42BitmapSubConverter.m in Sources */, A9B9C2A91823923200416A4E /* MatroskaParser.c in Sources */, A9B9C2A71823923200416A4E /* MatroskaFile.c in Sources */, );