summaryrefslogtreecommitdiff
path: root/libavformat/ffmdec.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-05-26 03:53:10 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-05-26 03:53:10 +0000
commite5ece1831a90251be771127cf8f3afff22ee3397 (patch)
treede23d41cde6b7f78185d8de45618bcc59515a88a /libavformat/ffmdec.c
parent278f987a33149351271fca9c89217545d2cae562 (diff)
downloadffmpeg-e5ece1831a90251be771127cf8f3afff22ee3397.tar.gz
return error if len is negative, prevent segfault
Originally committed as revision 13419 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 1ae24762b6..84bd5e9fba 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -89,6 +89,8 @@ static int ffm_read_data(AVFormatContext *s,
while (size > 0) {
redo:
len = ffm->packet_end - ffm->packet_ptr;
+ if (len < 0)
+ return -1;
if (len > size)
len = size;
if (len == 0) {