lavf/pcm: check size, do not produce invalid packets

Inspired by 92b8c9d89e.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2012-12-07 13:05:43 +00:00
parent ea6da80cb4
commit 8ca8b43d71

View File

@ -30,6 +30,8 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, size;
size= RAW_SAMPLES*s->streams[0]->codec->block_align;
if (size <= 0)
return AVERROR(EINVAL);
ret= av_get_packet(s->pb, pkt, size);