mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
TAV fix: '--intra-only --interlaced' would cause crash due to buffer size mismatch
This commit is contained in:
@@ -10979,6 +10979,14 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
// Halve internal height for interlaced mode (FFmpeg will output half-height fields)
|
||||
if (!enc->progressive_mode) {
|
||||
enc->height = enc->height / 2;
|
||||
if (enc->verbose) {
|
||||
printf("Interlaced mode: internal height adjusted to %d\n", enc->height);
|
||||
}
|
||||
}
|
||||
|
||||
// generate division series
|
||||
enc->widths = malloc((enc->decomp_levels + 2) * sizeof(int));
|
||||
enc->heights = malloc((enc->decomp_levels + 2) * sizeof(int));
|
||||
@@ -10994,15 +11002,6 @@ int main(int argc, char *argv[]) {
|
||||
enc->quantiser_cg = enc->quantiser_co;
|
||||
}
|
||||
|
||||
// Halve internal height for interlaced mode (FFmpeg will output half-height fields)
|
||||
if (!enc->progressive_mode) {
|
||||
enc->height = enc->height / 2;
|
||||
if (enc->verbose) {
|
||||
printf("Interlaced mode: internal height adjusted to %d\n", enc->height);
|
||||
}
|
||||
enc->intra_only = 1;
|
||||
}
|
||||
|
||||
// disable perceptual tuning if wavelet filter is not CDF 9/7
|
||||
if (enc->wavelet_filter != WAVELET_9_7_IRREVERSIBLE) {
|
||||
enc->perceptual_tuning = 0;
|
||||
|
||||
Reference in New Issue
Block a user