On Tue, Sep 17, 2013 at 07:36:04PM +0300, Martin Storsjö wrote: > This is required, since invalid parameters actually could > pass the switch check below. > > Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind > CC: [email protected] > --- > libavcodec/twinvqdec.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c > index a88b6ff..5279fe5 100644 > --- a/libavcodec/twinvqdec.c > +++ b/libavcodec/twinvqdec.c > @@ -356,6 +356,10 @@ static av_cold int twinvq_decode_init(AVCodecContext > *avctx) > : AV_CH_LAYOUT_STEREO; > > ibps = avctx->bit_rate / (1000 * avctx->channels); > + if (ibps < 8 || ibps > 48) { > + av_log(avctx, AV_LOG_ERROR, "Bad bitrate/channels combination\n"); > + return AVERROR_INVALIDDATA; > + } > > switch ((isampf << 8) + ibps) { > case (8 << 8) + 8: > --
bikeshed: bad bitrate per channel value %d kbps LGTM _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
