[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ./ChangeLog libbase/jpeg.cpp
From: |
Michael Carlson |
Subject: |
[Gnash-commit] gnash ./ChangeLog libbase/jpeg.cpp |
Date: |
Tue, 14 Feb 2006 16:26:17 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: Michael Carlson <address@hidden> 06/02/14 16:26:17
Modified files:
. : ChangeLog
libbase : jpeg.cpp
Log message:
Don't ever crash by trying to read headers of the same jpeg twice
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.136&tr2=1.137&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/jpeg.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.136 gnash/ChangeLog:1.137
--- gnash/ChangeLog:1.136 Tue Feb 14 13:55:59 2006
+++ gnash/ChangeLog Tue Feb 14 16:26:17 2006
@@ -11,6 +11,8 @@
* testsuite/actionscript.all/array.as: Change all tests to use
new check macro. Add tests for all implemented array functions,
as well as several tests for the unimplemented sort function.
+ * libbase/jpeg.cpp: don't ever crash by trying to read
+ headers of the same jpeg twice
2006-02-13 Rob Savoye <address@hidden>
Index: gnash/libbase/jpeg.cpp
diff -u gnash/libbase/jpeg.cpp:1.1 gnash/libbase/jpeg.cpp:1.2
--- gnash/libbase/jpeg.cpp:1.1 Tue Dec 20 20:57:00 2005
+++ gnash/libbase/jpeg.cpp Tue Feb 14 16:26:17 2006
@@ -284,7 +284,8 @@
struct jpeg_decompress_struct m_cinfo;
struct jpeg_error_mgr m_jerr;
- bool m_compressor_opened;
+ bool m_compressor_opened;
+ bool m_header_read;
enum SWF_DEFINE_BITS_JPEG2 { SWF_JPEG2 };
@@ -302,7 +303,9 @@
// Initialize decompression object.
jpeg_create_decompress(&m_cinfo);
- setup_rw_source(&m_cinfo, in);
+ setup_rw_source(&m_cinfo, in);
+
+ m_header_read = FALSE;
start_image();
}
@@ -328,6 +331,7 @@
// Read the encoding tables.
jpeg_read_header(&m_cinfo, FALSE);
+ m_header_read = TRUE;
// Don't start reading any image data!
// App does that manually using start_image.
@@ -372,7 +376,10 @@
assert(m_compressor_opened == false);
// Now, read the image header.
- jpeg_read_header(&m_cinfo, TRUE);
+ if (!m_header_read)
+ jpeg_read_header(&m_cinfo, TRUE);
+ m_header_read = TRUE;
+
jpeg_start_decompress(&m_cinfo);
m_compressor_opened = true;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ./ChangeLog libbase/jpeg.cpp,
Michael Carlson <=