File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/java/org/apache/sysds/runtime/transform/decode Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public void initMetaData(FrameBlock meta) {
8383 public void writeExternal (ObjectOutput out ) throws IOException {
8484 super .writeExternal (out );
8585 out .writeInt (_decoders .size ());
86+ out .writeInt (_schema == null ? 0 :_schema .length ); //write #columns
8687 for (Decoder decoder : _decoders ) {
8788 out .writeByte (DecoderFactory .getDecoderType (decoder ));
8889 decoder .writeExternal (out );
@@ -93,6 +94,9 @@ public void writeExternal(ObjectOutput out) throws IOException {
9394 public void readExternal (ObjectInput in ) throws IOException {
9495 super .readExternal (in );
9596 int decodersSize = in .readInt ();
97+ int nCols = in .readInt ();
98+ if (nCols > 0 && decodersSize > nCols *2 )
99+ throw new IOException ("Too many decoders" );
96100 _decoders = new ArrayList <>();
97101 for (int i = 0 ; i < decodersSize ; i ++) {
98102 Decoder decoder = DecoderFactory .createInstance (in .readByte ());
You can’t perform that action at this time.
0 commit comments