TAV fix: '--intra-only --interlaced' would cause crash due to buffer size mismatch

This commit is contained in:
minjaesong
2025-11-22 21:11:54 +09:00
parent 5129e354bb
commit e928d2d3ec
2 changed files with 160 additions and 39 deletions

View File

@@ -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;