This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new ac91f1c0f7 avdevice/pulse_audio_dec: validate sample spec before use
ac91f1c0f7 is described below
commit ac91f1c0f7001cd62528a2130a41379fd2b6d176
Author: zhanghongyuan <[email protected]>
AuthorDate: Thu Jun 18 13:19:31 2026 +0800
Commit: Marton Balint <[email protected]>
CommitDate: Tue Jul 14 21:25:25 2026 +0000
avdevice/pulse_audio_dec: validate sample spec before use
ff_codec_id_to_pulse_format() returns PA_SAMPLE_INVALID for
unsupported codecs (e.g. AAC, FLAC, Opus). Without validation,
the invalid format propagates to pa_frame_size() and other PA
calls, causing assertion failures or division-by-zero.
Add pa_sample_spec_valid() check, matching the existing guard
in pulse_audio_enc.c.
Signed-off-by: zhanghongyuan <[email protected]>
---
libavdevice/pulse_audio_dec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavdevice/pulse_audio_dec.c b/libavdevice/pulse_audio_dec.c
index 32be18e7dd..fe60d02b5d 100644
--- a/libavdevice/pulse_audio_dec.c
+++ b/libavdevice/pulse_audio_dec.c
@@ -156,6 +156,11 @@ static av_cold int pulse_read_header(AVFormatContext *s)
pa_channel_map_init_extend(&cmap, pd->channels, PA_CHANNEL_MAP_WAVEEX);
+ if (!pa_sample_spec_valid(&ss)) {
+ av_log(s, AV_LOG_ERROR, "Invalid sample spec.\n");
+ return AVERROR(EINVAL);
+ }
+
st = avformat_new_stream(s, NULL);
if (!st) {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]