changeset 9109:8053722e1c7f libavcodec

flacdec: Warn about invalid max blocksize and limit the minimum value.
author jbr
date Tue, 03 Mar 2009 05:53:38 +0000
parents fdc0db1e0087
children ac31a0265eb9
files flacdec.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flacdec.c	Tue Mar 03 05:26:39 2009 +0000
+++ b/flacdec.c	Tue Mar 03 05:53:38 2009 +0000
@@ -187,6 +187,11 @@
 
     skip_bits(&gb, 16); /* skip min blocksize */
     s->max_blocksize = get_bits(&gb, 16);
+    if (s->max_blocksize < 16) {
+        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n",
+               s->max_blocksize);
+        s->max_blocksize = 16;
+    }
 
     skip_bits(&gb, 24); /* skip min frame size */
     s->max_framesize = get_bits_long(&gb, 24);