summaryrefslogtreecommitdiff
path: root/libavcodec/cinepak.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-07-11 22:34:34 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-07-11 22:34:34 +0000
commit472ea1284e925297b08921b7189f57f6789c898c (patch)
treeb2afbd206c62ea7359bb19947903c06d882cb6ca /libavcodec/cinepak.c
parentb7b84107b54e795b4bfd5c67ce2536c4d6f559cd (diff)
fix infinite loop (suggested change by rjayne at convera dot com)
fixes bug #1160195 Originally committed as revision 4434 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cinepak.c')
-rw-r--r--libavcodec/cinepak.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 3c560fdc5f..3b00a1605d 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -274,6 +274,9 @@ static int cinepak_decode_strip (CinepakContext *s,
while ((data + 4) <= eod) {
chunk_id = BE_16 (&data[0]);
chunk_size = BE_16 (&data[2]) - 4;
+ if(chunk_size < 0)
+ return -1;
+
data += 4;
chunk_size = ((data + chunk_size) > eod) ? (eod - data) : chunk_size;