[FFmpeg-devel] [RFC] LPCM 24 bits support
Måns Rullgård
mans
Fri Apr 18 22:06:15 CEST 2008
Lars T?uber <lars.taeuber at gmx.net> writes:
> On Fri, 18 Apr 2008 15:39:43 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Thu, Apr 17, 2008 at 10:13:40PM +0200, Lars T?uber wrote:
>> > On Thu, 17 Apr 2008 22:49:08 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
>> > > On Thu, Apr 17, 2008 at 09:10:07PM +0100, M?ns Rullg?rd wrote:
> [...]
>> > diff -pur ffmpeg/libavcodec/pcm.c ffmpeg.1/libavcodec/pcm.c
>> > --- ffmpeg/libavcodec/pcm.c 2008-03-21 13:17:05.000000000 +0100
>> > +++ ffmpeg.1/libavcodec/pcm.c 2008-04-17 21:46:27.000000000 +0200
>> > @@ -492,6 +498,31 @@ static int pcm_decode_frame(AVCodecConte
>> > *samples++ = s->table[*src++];
>> > }
>> > break;
>> > + case CODEC_ID_PCM_DVD: {
>> > + int audio24[8*2], *ap;
>> > + const uint8_t *src_LSB;
>> > +
>>
>> > + n = buf_size / (avctx->channels * 2 * avctx->bits_per_sample / 8);
>>
>> Is there something that prevents that from overflowing? If not then
>> this is a little risky
>
> I'm not sure what you mean, but all values are calculated in
> libavformat/mpeg.c during parsing:
What if something else set the values? Not all data comes from lavf,
and it could have been corrupted underway. Never assume anything
about input data.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list