aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-12-07 13:05:43 +0000
committerPaul B Mahol <onemda@gmail.com>2012-12-07 13:05:43 +0000
commit8ca8b43d7108b9d7e6887fd553d13a71afa670c6 (patch)
treedbaf2a2a3742b7ed799cc3246b8a8ae668d35bad /libavformat
parentea6da80cb41af9e854822d72b5dbe92ea5ca9909 (diff)
downloadffmpeg-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')
-rw-r--r--libavformat/pcm.c2
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);