changeset 27162:045b7646abb2

Check stdata_len before accessing stdata. Fixes bug #1125
author reimar
date Fri, 04 Jul 2008 15:47:31 +0000
parents b4094f8dccf0
children 704a4fdb762a
files libmpdemux/demux_mov.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Fri Jul 04 14:35:44 2008 +0000
+++ b/libmpdemux/demux_mov.c	Fri Jul 04 15:47:31 2008 +0000
@@ -657,6 +657,10 @@
 //      36  char[]  	atom data (len=size-8)
 
 // TODO: fix parsing for files using version 2.
+		if (trak->stdata_len < 26) {
+		  mp_msg(MSGT_DEMUX, MSGL_WARN, "MOV: broken (too small) sound atom!\n");
+		  return 0;
+		}
 		version=char2short(trak->stdata,8);
 		if (version > 1)
 		  mp_msg(MSGT_DEMUX, MSGL_WARN, "MOV: version %d sound atom may not parse correctly!\n", version);