changeset 1712:fdeab224942d libavformat

check to detect nonsense fragment size
author michael
date Mon, 22 Jan 2007 21:17:54 +0000
parents 56ec1daf3ffb
children e48ab5187493
files asf.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Mon Jan 22 17:06:46 2007 +0000
+++ b/asf.c	Mon Jan 22 21:17:54 2007 +0000
@@ -571,6 +571,10 @@
     }
     if (asf->packet_flags & 0x01) {
         DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
+        if(asf->packet_frag_size > asf->packet_size_left - rsize){
+            av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid\n");
+            return -1;
+        }
         //printf("Fragsize %d\n", asf->packet_frag_size);
     } else {
         asf->packet_frag_size = asf->packet_size_left - rsize;