On Wed, Feb 14, 2018 at 03:41:18PM +0100, Tomas Härdin wrote: [..snip..] > FFMAX(codec->sample_rate/25, 1) would be nicer > agree.
> > + size = FFMIN(size, RAW_SAMPLES * codec->block_align);
> > + size = 1 << ff_log2(size);
> > - size= RAW_SAMPLES*s->streams[0]->codecpar->block_align;
> > if (size <= 0)
> > return AVERROR(EINVAL);
>
> This will never be true since ff_log() always returns >= 0 which makes size
> >= 1. I suggest putting it before the 1 << ff_log2.
>
This can only happen when block_align == 0. So, a check à la
if (codec->block_align <= 0)
return AVERROR(EINVAL);
before calculating the size, should suffice?
> > - ret= av_get_packet(s->pb, pkt, size);
> > + ret = av_get_packet(s->pb, pkt, size);
>
> Doesn't looks like it belongs, but it makes all the assignments align so
> whatever
>
> /Tomas
> _______________________________________________
> ffmpeg-devel mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
