CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/12/14 16:00:27
Modified files: . : ChangeLog server : stream.cpp Log message: don't allow block reads to cross tag boundaries. Fixes many jpeg-parsing related seek-backs. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5174&r2=1.5175 http://cvs.savannah.gnu.org/viewcvs/gnash/server/stream.cpp?cvsroot=gnash&r1=1.40&r2=1.41 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5174 retrieving revision 1.5175 diff -u -b -r1.5174 -r1.5175 --- ChangeLog 14 Dec 2007 14:24:36 -0000 1.5174 +++ ChangeLog 14 Dec 2007 16:00:26 -0000 1.5175 @@ -1,5 +1,10 @@ 2007-12-14 Sandro Santilli <[EMAIL PROTECTED]> + * server/stream.cpp (read): don't allow block reads to cross + tag boundaries. + +2007-12-14 Sandro Santilli <[EMAIL PROTECTED]> + * libmedia/FLVParser.h: drop comma at end of enumerator list * server/swf/tag_loaders.cpp: provide a 'tell' function to StreamAdapter. Index: server/stream.cpp =================================================================== RCS file: /sources/gnash/gnash/server/stream.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -b -r1.40 -r1.41 --- server/stream.cpp 12 Dec 2007 10:07:01 -0000 1.40 +++ server/stream.cpp 14 Dec 2007 16:00:27 -0000 1.41 @@ -48,6 +48,20 @@ unsigned stream::read(char *buf, unsigned count) { align(); + + // If we're in a tag, make sure we're not seeking outside the tag. + if ( ! _tagBoundsStack.empty() ) + { + TagBoundaries& tb = _tagBoundsStack.back(); + unsigned long end_pos = tb.second; + unsigned long cur_pos = get_position(); + assert(end_pos >= cur_pos); + unsigned long left = end_pos - cur_pos; + if ( left < count ) count = left; + } + + if ( ! count ) return 0; + return m_input->read_bytes(buf, count); } @@ -381,7 +395,7 @@ align(); // If we're in a tag, make sure we're not seeking outside the tag. - if (_tagBoundsStack.size() > 0) + if ( ! _tagBoundsStack.empty() ) { TagBoundaries& tb = _tagBoundsStack.back(); unsigned long end_pos = tb.second; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit