changeset 1063:fdeac9642346 libavcodec

check for qscale==0 (fixes 1/0 on one corrupted stream)
author michaelni
date Mon, 10 Feb 2003 22:43:30 +0000
parents e4c1df460506
children b32afefe7d33
files msmpeg4.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/msmpeg4.c	Mon Feb 10 17:52:01 2003 +0000
+++ b/msmpeg4.c	Mon Feb 10 22:43:30 2003 +0000
@@ -1228,6 +1228,10 @@
 }
 #endif
     s->qscale = get_bits(&s->gb, 5);
+    if(s->qscale==0){
+        fprintf(stderr, "invalid qscale\n");
+        return -1;
+    }
 
     if (s->pict_type == I_TYPE) {
         code = get_bits(&s->gb, 5);