ffmpeg/tests
Andreas Rheinhardt 11d3af0d7f avcodec/dfpwmenc: Correctly pad input
Before this patch, the DFPWM1a encoder was marked as supporting
variable frame sizes. The DFPWM1a format converts eight bytes
of input into one output byte and so it simply padded the number
of data output by
frame->nb_samples * frame->ch_layout.nb_channels / 8 +
(frame->nb_samples % 8 > 0 ? 1 : 0)
This has several bugs:
a) The additional byte leads to eight additional input byte being
read; this can read into the frame's padding, i.e. the data can
be uninitialized.
b) The criterion for whether one should pad is wrong:
nb_samples * nb_channels should be tested for divisibility by eight.
c) The created frames can be undecodable (at least with our decoder):
Our decoder requires the number of bits per frame to divisible by
the number of channels, yet the above approach does not guarantee this.
d) The padding will be added in the middle of the stream (potentially
for every packet).

This commit fixes all of this by removing the variable frame size cap
and using AVCodecInternal.pad_samples to pad the last frame so that
nb_samples * nb_channels is always a multiple of eight.
The lavf-dfpwm FATE-test was affected by a). The frames originated from
lavfi and were part of an audio frame pool, so that the padding
contained data from an earlier (bigger) frame. Now the last frame is
properly filled with silence.

Reported-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-03 20:18:55 +02:00
..
api tests/api/api-dump-stream-meta-test: Fix leaks 2025-05-05 17:03:39 +02:00
checkasm configure: Factor mpegvideoencdsp out of mpegvideoenc 2025-06-21 22:08:52 +02:00
fate tests/fate/screen: Add test for skipping cursor with FIC 2025-07-03 19:42:28 +02:00
filtergraphs tests/iamf: rename BACK to SIDE filterchain labels in the 5.1.4 iamf tests 2025-06-24 14:41:43 -03:00
maps fate: Add fsync filter tests 2024-01-05 09:29:05 +01:00
ref avcodec/dfpwmenc: Correctly pad input 2025-07-03 20:18:55 +02:00
streamgroups avformat/iamf: use the correct layouts for Sound Systems B and C 2025-01-03 10:27:13 -03:00
.gitignore
audiogen.c tests/audiogen: Fix total RIFF chunk size 2024-03-28 11:54:41 +01:00
audiomatch.c tests/audiomatch: add free to make static analysis tools happy 2020-12-10 19:38:32 +08:00
base64.c
copycooker.sh
extended.ffconcat lavf/concat: deprecate file_packet_metadata 2021-09-16 10:17:59 +02:00
fate-run.sh tests/fate-run: Remove intermediate files from enc-external tests 2025-06-06 16:21:47 +02:00
fate-valgrind.supp
fate.sh fate: allow https for git URLs 2024-04-27 23:24:58 +02:00
Makefile Remove libpostproc 2025-05-07 15:35:47 +02:00
md5.sh
refcmp-metadata.awk fate/filter-refcmp-*: make refcmp_metadata fail on empty or truncated input 2022-04-10 20:12:23 +02:00
reference.pnm
rotozoom.c
simple1.ffconcat lavf/concat: deprecate file_packet_metadata 2021-09-16 10:17:59 +02:00
simple2.ffconcat tests/concat-demuxer: add stream_meta test 2021-09-16 10:17:59 +02:00
test.ffmeta
tiny_psnr.c
tiny_ssim.c test: tiny_ssim: Don't include config.h 2022-03-30 14:56:07 +03:00
utils.c
videogen.c