summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesTrack.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-06-08 16:20:43 +0200
committerDamiano Galassi <[email protected]>2019-06-08 16:20:43 +0200
commitc36996ced365c839b01c5297d799ba79f1e05299 (patch)
treeb584d6a570d36def3f07ef7a4e8f7ae36ac0f64c /macosx/HBSubtitlesTrack.m
parent908b78452f8e53b5a9de3a592949eb30b21a5ec5 (diff)
MacGui: write the queue to disk less often and add some validations when reading it back from disk.
Diffstat (limited to 'macosx/HBSubtitlesTrack.m')
-rw-r--r--macosx/HBSubtitlesTrack.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/macosx/HBSubtitlesTrack.m b/macosx/HBSubtitlesTrack.m
index 412f59840..78fced933 100644
--- a/macosx/HBSubtitlesTrack.m
+++ b/macosx/HBSubtitlesTrack.m
@@ -370,9 +370,9 @@ NSString *keySubTrackExternalFileURLBookmark = @"keySubTrackSrtFileURLBookmark";
{
self = [super init];
- decodeInteger(_sourceTrackIdx);
- decodeInt(_type);
- decodeInt(_container);
+ decodeInteger(_sourceTrackIdx); if (_sourceTrackIdx < 0) { goto fail; }
+ decodeInt(_type); if (_type < VOBSUB || _type > SRTSUB) { goto fail; }
+ decodeInt(_container); if (_container != HB_MUX_MP4 && _container != HB_MUX_MKV && _container != HB_MUX_WEBM) { goto fail; }
decodeBool(_forcedOnly);
decodeBool(_burnedIn);
@@ -384,6 +384,9 @@ NSString *keySubTrackExternalFileURLBookmark = @"keySubTrackSrtFileURLBookmark";
decodeInt(_offset);
return self;
+
+fail:
+ return nil;
}
@end