Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: core/fxcodec/codec/fx_codec_jpx_opj.cpp

Issue 2071693002: Remove openjpeg write support. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: clean up struct definition Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcodec/codec/codec_int.h ('k') | core/fxcodec/codec/fx_codec_jpx_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_jpx_opj.cpp
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index fa163567f4235eefa0ef9fe71cb863d4c2a838f1..eccf8762186b8aa3922eae08f80c93acc8b104b5 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -44,24 +44,6 @@ OPJ_SIZE_T opj_read_from_memory(void* p_buffer,
return readlength;
}
-OPJ_SIZE_T opj_write_from_memory(void* p_buffer,
- OPJ_SIZE_T nb_bytes,
- void* p_user_data) {
- DecodeData* srcData = static_cast<DecodeData*>(p_user_data);
- if (!srcData || !srcData->src_data || srcData->src_size == 0) {
- return static_cast<OPJ_SIZE_T>(-1);
- }
- // Writes at EOF return an error code.
- if (srcData->offset >= srcData->src_size) {
- return static_cast<OPJ_SIZE_T>(-1);
- }
- OPJ_SIZE_T bufferLength = srcData->src_size - srcData->offset;
- OPJ_SIZE_T writeLength = nb_bytes < bufferLength ? nb_bytes : bufferLength;
- memcpy(&srcData->src_data[srcData->offset], p_buffer, writeLength);
- srcData->offset += writeLength;
- return writeLength;
-}
-
OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data) {
DecodeData* srcData = static_cast<DecodeData*>(p_user_data);
if (!srcData || !srcData->src_data || srcData->src_size == 0) {
@@ -132,7 +114,6 @@ opj_stream_t* fx_opj_stream_create_memory_stream(DecodeData* data,
opj_stream_set_user_data(l_stream, data, nullptr);
opj_stream_set_user_data_length(l_stream, data->src_size);
opj_stream_set_read_function(l_stream, opj_read_from_memory);
- opj_stream_set_write_function(l_stream, opj_write_from_memory);
opj_stream_set_skip_function(l_stream, opj_skip_from_memory);
opj_stream_set_seek_function(l_stream, opj_seek_from_memory);
return l_stream;
« no previous file with comments | « core/fxcodec/codec/codec_int.h ('k') | core/fxcodec/codec/fx_codec_jpx_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698