diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-07 13:05:43 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-07 13:05:43 +0000 |
commit | 8ca8b43d7108b9d7e6887fd553d13a71afa670c6 (patch) | |
tree | dbaf2a2a3742b7ed799cc3246b8a8ae668d35bad /libavformat/pcm.c | |
parent | ea6da80cb41af9e854822d72b5dbe92ea5ca9909 (diff) | |
download | ffmpeg-8ca8b43d7108b9d7e6887fd553d13a71afa670c6.tar.gz |
lavf/pcm: check size, do not produce invalid packets
Inspired by 92b8c9d89e7ae86bffa05393bb230d5a165b0148.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/pcm.c')
-rw-r--r-- | libavformat/pcm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/pcm.c b/libavformat/pcm.c index 71f6a4f653..2fe44dcb40 100644 --- a/libavformat/pcm.c +++ b/libavformat/pcm.c @@ -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); |