File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -170,13 +170,18 @@ int dfltcc_deflate(
170
170
param -> bcf = 0 ;
171
171
dfltcc_state -> block_threshold =
172
172
strm -> total_in + dfltcc_state -> block_size ;
173
- if (strm -> avail_out == 0 ) {
174
- * result = need_more ;
175
- return 1 ;
176
- }
177
173
}
178
174
}
179
175
176
+ /* No space for compressed data. If we proceed, dfltcc_cmpr() will return
177
+ * DFLTCC_CC_OP1_TOO_SHORT without buffering header bits, but we will still
178
+ * set BCF=1, which is wrong. Avoid complications and return early.
179
+ */
180
+ if (strm -> avail_out == 0 ) {
181
+ * result = need_more ;
182
+ return 1 ;
183
+ }
184
+
180
185
/* The caller gave us too much data. Pass only one block worth of
181
186
* uncompressed data to DFLTCC and mask the rest, so that on the next
182
187
* iteration we start a new block.
You can’t perform that action at this time.
0 commit comments