In the hardening commit (4dd5e63), output validation was moved inside the MOVE_SOURCE condition, meaning it only ran when --unattended was specified. This caused a critical regression: without --unattended, invalid/corrupt output files were accepted without validation. Move validate_transcoded_output() outside the MOVE_SOURCE block so it always runs, regardless of whether source deletion is enabled. This restores proper quality checks for all transcoding operations. Regression introduced in: 4dd5e63 (Harden Varia transcoding over NFS) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@@ -1842,22 +1842,20 @@ process_video_file() {
|
||
| 1842 | 1842 |
return 3 |
| 1843 | 1843 |
fi |
| 1844 | 1844 |
|
| 1845 |
- if [[ "$MOVE_SOURCE" == true ]]; then |
|
| 1846 |
- if ! validate_transcoded_output "$encode_input_file" "$temp_output_file"; then |
|
| 1847 |
- cleanup_transcode_artifacts "$temp_output_file" "$output_file" |
|
| 1848 |
- ERRORS=$((ERRORS + 1)) |
|
| 1849 |
- if destination_cannot_accept_file "$input_file" "$out_dir" ""; then |
|
| 1850 |
- DESTINATION_FAILURES=$((DESTINATION_FAILURES + 1)) |
|
| 1851 |
- cleanup_process_inputs "$staged_input_file" "$repacked_input_file" |
|
| 1852 |
- return 3 |
|
| 1853 |
- fi |
|
| 1854 |
- # Validation failed but destination is healthy: the source or encoder produced |
|
| 1855 |
- # a corrupt/truncated output. Treat as source error so --keep-going can skip it. |
|
| 1856 |
- INVALID_SOURCES_SKIPPED=$((INVALID_SOURCES_SKIPPED + 1)) |
|
| 1857 |
- log_msg "ERROR" "Encode produced invalid output (source may be corrupt): $input_file" |
|
| 1845 |
+ if ! validate_transcoded_output "$encode_input_file" "$temp_output_file"; then |
|
| 1846 |
+ cleanup_transcode_artifacts "$temp_output_file" "$output_file" |
|
| 1847 |
+ ERRORS=$((ERRORS + 1)) |
|
| 1848 |
+ if destination_cannot_accept_file "$input_file" "$out_dir" ""; then |
|
| 1849 |
+ DESTINATION_FAILURES=$((DESTINATION_FAILURES + 1)) |
|
| 1858 | 1850 |
cleanup_process_inputs "$staged_input_file" "$repacked_input_file" |
| 1859 |
- return 2 |
|
| 1851 |
+ return 3 |
|
| 1860 | 1852 |
fi |
| 1853 |
+ # Validation failed but destination is healthy: the source or encoder produced |
|
| 1854 |
+ # a corrupt/truncated output. Treat as source error so --keep-going can skip it. |
|
| 1855 |
+ INVALID_SOURCES_SKIPPED=$((INVALID_SOURCES_SKIPPED + 1)) |
|
| 1856 |
+ log_msg "ERROR" "Encode produced invalid output (source may be corrupt): $input_file" |
|
| 1857 |
+ cleanup_process_inputs "$staged_input_file" "$repacked_input_file" |
|
| 1858 |
+ return 2 |
|
| 1861 | 1859 |
fi |
| 1862 | 1860 |
|
| 1863 | 1861 |
touch -r "$input_file" "$temp_output_file" || true |