[FFmpeg-devel] [PATCH 2/2] lavd/alsa: add stream validation

Nicolas George george at nsup.org
Sat Oct 26 11:36:21 CEST 2013

Le quintidi 5 brumaire, an CCXXII, Lukasz Marek a écrit :
> Don't trust provided streams. Find first audio stream and use it.
> Make a warning if more than one.
> Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>

Thanks for the patch. You are right the input should be sanitized. But I
believe your solution is too lenient: silently ignoring streams is just as
bad as producing a garbled output.

I believe it would be better to just reject configurations with anything but
a single audio stream:

    if (s1->nb_streams != 1 || st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
	av_log(s1, AV_LOG_ERROR, "Only a single audio stream supported\n");

Don't you agree?


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131026/6bc7c0ef/attachment.asc>

More information about the ffmpeg-devel mailing list