ffmpeg-bb/tests/ref/lavf
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
..
aiff fate/lavf-audio: Test writing AIFF-native tags 2024-03-17 16:08:13 +01:00
al tests: Convert audio-only lavf tests to non-legacy test scripts 2019-02-16 18:15:22 +01:00
apng avcodec/pngenc: set default prediction method to PAETH 2025-04-10 03:01:33 +02:00
apng.png avcodec/pngenc: set default prediction method to PAETH 2025-04-10 03:01:33 +02:00
asf fftools/ffmpeg: propagate frame durations to packets when encoding 2023-04-19 21:12:03 +02:00
ast avformat/pcm: decrease target audio frame per sec to 10 2024-03-16 19:19:42 +01:00
au Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
avi Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
bmp tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
caf Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
dfpwm avcodec/dfpwmenc: Correctly pad input 2025-07-03 20:18:55 +02:00
dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
dv Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
dv_ntsc fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
dv_pal Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
flm Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
flv Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
gbrap.fits avformat/fitsenc: write DATAMIN/DATAMAX to encoded output 2021-02-10 00:03:38 +01:00
gbrap16be.fits avformat/fitsenc: write DATAMIN/DATAMAX to encoded output 2021-02-10 00:03:38 +01:00
gbrp.fits avformat/fitsenc: write DATAMIN/DATAMAX to encoded output 2021-02-10 00:03:38 +01:00
gbrp10le.dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
gbrp12le.dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
gbrp16be.fits avformat/fitsenc: write DATAMIN/DATAMAX to encoded output 2021-02-10 00:03:38 +01:00
gbrpf32be.pfm avcodec/pnm: avoid mirroring PFM images vertically 2022-12-27 10:41:25 -03:00
gbrpf32le.pfm avcodec/pnm: avoid mirroring PFM images vertically 2022-12-27 10:41:25 -03:00
gif tests/fate: fix mismatches between requested and actually used pixel formats 2023-07-20 20:30:13 +02:00
gray.fits avformat/fitsenc: write DATAMIN/DATAMAX to encoded output 2021-02-10 00:03:38 +01:00
gray.pam tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
gray.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
gray16be.fits swscale/range_convert: fix mpeg ranges in yuv range conversion for non-8-bit pixel formats 2024-12-05 21:10:29 +01:00
gray16be.pam swscale/range_convert: fix mpeg ranges in yuv range conversion for non-8-bit pixel formats 2024-12-05 21:10:29 +01:00
gray16be.png avcodec/pngenc: set default prediction method to PAETH 2025-04-10 03:01:33 +02:00
grayf32be.pfm avcodec/pnm: avoid mirroring PFM images vertically 2022-12-27 10:41:25 -03:00
grayf32le.pfm avcodec/pnm: avoid mirroring PFM images vertically 2022-12-27 10:41:25 -03:00
gxf Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
gxf_ntsc fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
gxf_pal Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
ircam Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
ismv fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
jpg avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort entries by length 2025-04-18 08:40:17 +02:00
mka avformat/matroskaenc: Write default duration for audio 2023-10-02 12:22:20 +02:00
mkv avcodec/pnm: explicitly tag color range 2023-11-09 12:53:35 +01:00
mkv_attachment avcodec/pnm: explicitly tag color range 2023-11-09 12:53:35 +01:00
mmf Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
monob.pam tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
monow.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
mov avformat/pcm: decrease target audio frame per sec to 10 2024-03-16 19:19:42 +01:00
mov_hybrid_frag movenc: Add an option for resilient, hybrid fragmented/non-fragmented muxing 2024-06-24 11:24:04 +03:00
mov_rtphint avformat/sdp: add framerate entry 2025-06-11 19:19:50 +02:00
mp4 fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
mpg fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
mxf avcodec/pnm: explicitly tag color range 2023-11-09 12:53:35 +01:00
mxf_d10 fftools/ffmpeg_enc: apply -top to individual encoded frames 2023-09-18 17:15:53 +02:00
mxf_dv25 lavc/dv: remove ff_dvvideo_init() 2022-09-05 08:02:28 +02:00
mxf_dvcpro50 avformat/mxfenc: allow more bits for variable part in uuid generation 2022-03-16 21:37:53 +01:00
mxf_dvcpro100 avformat/mxfenc: fix stored/sampled/displayed width/height 2023-03-26 22:04:44 +02:00
mxf_ffv1 avformat/mxfenc: SMPTE RDD 48:2018 Amd 1:2022 support 2023-03-25 19:28:36 +01:00
mxf_opatom avformat/mxfenc: fix stored/sampled/displayed width/height 2023-03-26 22:04:44 +02:00
mxf_opatom_audio avformat/mxfenc: allow more bits for variable part in uuid generation 2022-03-16 21:37:53 +01:00
none.gbrapf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
none.gbrpf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
none.grayf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
nut Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
ogg avformat/oggenc: don't flush twice when the last packet is side data only 2023-01-03 21:35:03 -03:00
pam tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
pbmpipe Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363' 2019-03-14 14:15:46 -03:00
pcx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
peak.wav Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
peak_only.wav fate/lavf-audio: Disable CRC for lavf-peak_only.wav test 2022-05-06 05:39:10 +02:00
pgm tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
pgmpipe Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363' 2019-03-14 14:15:46 -03:00
png avcodec/pngenc: set default prediction method to PAETH 2025-04-10 03:01:33 +02:00
ppm tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
ppmpipe tests: Convert image2pipe tests to non-legacy test scripts 2019-02-16 18:15:11 +01:00
qoi tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
qoipipe fate: add QOI/XBM/XWD image2pipe tests 2022-12-03 19:38:11 +01:00
rgb4_byte.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb8.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb48be.pam tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb48be.png avcodec/pngenc: set default prediction method to PAETH 2025-04-10 03:01:33 +02:00
rgb48le.dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb48le_10.dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb555be.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgb565be.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgba.pam tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgba.xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rgba64le.dpx tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
rle.gbrapf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
rle.gbrpf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
rle.grayf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
rm ac3: convert to lavu/tx 2022-11-06 14:39:27 +01:00
rso tests: Convert audio-only lavf tests to non-legacy test scripts 2019-02-16 18:15:22 +01:00
s16.voc avformat/pcm: decrease target audio frame per sec to 10 2024-03-16 19:19:42 +01:00
sgi avcodec/sgidec: Use planar pixel formats 2022-10-05 14:38:51 +02:00
smjpeg avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort entries by length 2025-04-18 08:40:17 +02:00
sox tests: Convert audio-only lavf tests to non-legacy test scripts 2019-02-16 18:15:22 +01:00
sun tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
swf Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
tga tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
tiff tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
ts avformat/mpegtsenc: get rid of packet counting for sdt/pat/pmt 2019-08-23 22:49:01 +02:00
tta Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
ul tests: Convert audio-only lavf tests to non-legacy test scripts 2019-02-16 18:15:22 +01:00
voc avformat/pcm: decrease target audio frame per sec to 10 2024-03-16 19:19:42 +01:00
w64 Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
wav Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
wbmp avcodec: WBMP (Wireless Application Protocol Bitmap) image format 2022-08-07 19:18:18 +10:00
wtv Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c' 2019-03-14 14:36:24 -03:00
wv Merge commit 'eb8a8115994434b548523cf0bca6a4a74784e79c' 2019-03-14 14:19:03 -03:00
xbm tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
xbmpipe fate: add QOI/XBM/XWD image2pipe tests 2022-12-03 19:38:11 +01:00
xwd tests/fate-run: Allow to skip file checksums for lavf_image 2022-08-02 02:27:05 +02:00
xwdpipe fate: add QOI/XBM/XWD image2pipe tests 2022-12-03 19:38:11 +01:00
y4m avcodec/pnm: explicitly tag color range 2023-11-09 12:53:35 +01:00
zip1.gbrapf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
zip1.gbrpf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
zip1.grayf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
zip16.gbrapf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
zip16.gbrpf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00
zip16.grayf32le.exr fate/lavf-image: Disable file checksums for exr tests 2022-08-02 02:30:26 +02:00