changeset 6286:bb928e39c078 libavformat

asfdec: Don't read the video stream header if there isn't enough data
author mstorsjo
date Tue, 20 Jul 2010 11:52:29 +0000
parents 14c5d7cc71aa
children 3800dce5a40a
files asfdec.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/asfdec.c	Tue Jul 20 11:50:57 2010 +0000
+++ b/asfdec.c	Tue Jul 20 11:52:29 2010 +0000
@@ -361,7 +361,8 @@
                     st->codec->frame_size = 1;
                     break;
                 }
-            } else if (type == AVMEDIA_TYPE_VIDEO) {
+            } else if (type == AVMEDIA_TYPE_VIDEO &&
+                       gsize - (url_ftell(pb) - pos1 + 24) >= 53) {
                 get_le32(pb);
                 get_le32(pb);
                 get_byte(pb);