Check if we are overwriting the source file and disallow it.
This commit is contained in:
1 parent
4c2323a0c7
commit
5c8620f9d8
1 file changed
+11
@@ -675,6 +675,17 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (MP42Track *track in self.tracks) {
|
||||||
|
NSURL *sourceURL = track.sourceURL.filePathURL;
|
||||||
|
if ([sourceURL isEqualTo:url]) {
|
||||||
|
if (outError) {
|
||||||
|
*outError = MP42Error(@"Invalid destination.", @"Can't overwrite the source movie.", 100);
|
||||||
|
[_logger writeErrorToLog:*outError];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (self.hasFileRepresentation) {
|
if (self.hasFileRepresentation) {
|
||||||
__block BOOL noErr = YES;
|
__block BOOL noErr = YES;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user