Commit 8ca8b43d authored by Paul B Mahol's avatar Paul B Mahol

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

Inspired by 92b8c9d8.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent ea6da80c
...@@ -30,6 +30,8 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -30,6 +30,8 @@ int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, size; int ret, size;
size= RAW_SAMPLES*s->streams[0]->codec->block_align; size= RAW_SAMPLES*s->streams[0]->codec->block_align;
if (size <= 0)
return AVERROR(EINVAL);
ret= av_get_packet(s->pb, pkt, size); ret= av_get_packet(s->pb, pkt, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment