… | |
… | |
136 | res = -PSICONV_E_GENERATE; |
136 | res = -PSICONV_E_GENERATE; |
137 | goto ERROR1; |
137 | goto ERROR1; |
138 | } |
138 | } |
139 | |
139 | |
140 | if (!(extra_buf = psiconv_buffer_new())) { |
140 | if (!(extra_buf = psiconv_buffer_new())) { |
|
|
141 | psiconv_error(config,lev+1,0,"Out of memory error"); |
141 | res = -PSICONV_E_NOMEM; |
142 | res = -PSICONV_E_NOMEM; |
142 | goto ERROR1; |
143 | goto ERROR1; |
143 | } |
144 | } |
144 | if ((res = psiconv_write_size(config,extra_buf,lev+1,value->font_size))) |
145 | if ((res = psiconv_write_size(config,extra_buf,lev+1,value->font_size))) |
145 | goto ERROR2; |
146 | goto ERROR2; |
… | |
… | |
153 | if ((res = psiconv_write_font(config,extra_buf,lev+1,value->font))) |
154 | if ((res = psiconv_write_font(config,extra_buf,lev+1,value->font))) |
154 | goto ERROR2; |
155 | goto ERROR2; |
155 | |
156 | |
156 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
157 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
157 | goto ERROR2; |
158 | goto ERROR2; |
158 | res = psiconv_buffer_concat(buf,extra_buf); |
159 | if ((res = psiconv_buffer_concat(buf,extra_buf))) { |
|
|
160 | psiconv_error(config,lev+1,0,"Out of memory error"); |
|
|
161 | goto ERROR2; |
|
|
162 | } |
159 | |
163 | |
160 | ERROR2: |
164 | ERROR2: |
161 | psiconv_buffer_free(extra_buf); |
165 | psiconv_buffer_free(extra_buf); |
162 | ERROR1: |
166 | ERROR1: |
163 | if (res) |
167 | if (res) |
… | |
… | |
397 | goto ERROR2; |
401 | goto ERROR2; |
398 | if ((res = psiconv_write_length(config,extra_buf,lev+1,value->tabs->normal))) |
402 | if ((res = psiconv_write_length(config,extra_buf,lev+1,value->tabs->normal))) |
399 | goto ERROR2; |
403 | goto ERROR2; |
400 | for (i = 0; i < psiconv_list_length(value->tabs->extras); i++) { |
404 | for (i = 0; i < psiconv_list_length(value->tabs->extras); i++) { |
401 | if (!(tab = psiconv_list_get(value->tabs->extras,i))) { |
405 | if (!(tab = psiconv_list_get(value->tabs->extras,i))) { |
402 | psiconv_error(config,lev+1,0,"Massive memory corruption"); |
406 | psiconv_error(config,lev+1,0,"Data structure corruption"); |
403 | res = -PSICONV_E_NOMEM; |
407 | res = -PSICONV_E_NOMEM; |
404 | goto ERROR2; |
408 | goto ERROR2; |
405 | } |
409 | } |
406 | if ((res = psiconv_write_u8(config,extra_buf,lev+1,0x17))) |
410 | if ((res = psiconv_write_u8(config,extra_buf,lev+1,0x17))) |
407 | goto ERROR2; |
411 | goto ERROR2; |
… | |
… | |
411 | } |
415 | } |
412 | |
416 | |
413 | if ((res = psiconv_write_u32(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
417 | if ((res = psiconv_write_u32(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
414 | goto ERROR2; |
418 | goto ERROR2; |
415 | |
419 | |
416 | res = psiconv_buffer_concat(buf,extra_buf); |
420 | if ((res = psiconv_buffer_concat(buf,extra_buf))) { |
|
|
421 | psiconv_error(config,lev+1,0,"Out of memory error"); |
|
|
422 | goto ERROR2; |
|
|
423 | } |
417 | |
424 | |
418 | ERROR2: |
425 | ERROR2: |
419 | psiconv_buffer_free(extra_buf); |
426 | psiconv_buffer_free(extra_buf); |
420 | ERROR1: |
427 | ERROR1: |
421 | if (res) |
428 | if (res) |