… | |
… | |
107 | return 0; |
107 | return 0; |
108 | |
108 | |
109 | ERROR2: |
109 | ERROR2: |
110 | psiconv_list_free(*result); |
110 | psiconv_list_free(*result); |
111 | ERROR1: |
111 | ERROR1: |
112 | psiconv_warn(config,lev+1,off,"Reading of Jumptable Section failed"); |
112 | psiconv_error(config,lev+1,off,"Reading of Jumptable Section failed"); |
113 | if (length) |
113 | if (length) |
114 | *length = 0; |
114 | *length = 0; |
115 | if (!res) |
115 | if (!res) |
116 | return -PSICONV_E_NOMEM; |
116 | return -PSICONV_E_NOMEM; |
117 | else |
117 | else |
… | |
… | |
151 | psiconv_progress(config,lev+2,off+len,"Going to read pixel data offset"); |
151 | psiconv_progress(config,lev+2,off+len,"Going to read pixel data offset"); |
152 | offset = psiconv_read_u32(config,buf,lev+2,off+len,&res); |
152 | offset = psiconv_read_u32(config,buf,lev+2,off+len,&res); |
153 | if (res) |
153 | if (res) |
154 | goto ERROR3; |
154 | goto ERROR3; |
155 | if (offset != 0x28) { |
155 | if (offset != 0x28) { |
156 | psiconv_warn(config,lev+2,off+len, |
156 | psiconv_error(config,lev+2,off+len, |
157 | "Paint data section data offset has unexpected value"); |
157 | "Paint data section data offset has unexpected value"); |
158 | psiconv_debug(config,lev+2,off+len, |
158 | psiconv_debug(config,lev+2,off+len, |
159 | "Data offset: read %08x, expected %08x",offset,0x28); |
159 | "Data offset: read %08x, expected %08x",offset,0x28); |
160 | res = -1; |
160 | res = -1; |
161 | } |
161 | } |
… | |
… | |
360 | ERROR3: |
360 | ERROR3: |
361 | psiconv_list_free(bytes); |
361 | psiconv_list_free(bytes); |
362 | ERROR2: |
362 | ERROR2: |
363 | free(*result); |
363 | free(*result); |
364 | ERROR1: |
364 | ERROR1: |
365 | psiconv_warn(config,lev+1,off,"Reading of Paint Data Section failed"); |
365 | psiconv_error(config,lev+1,off,"Reading of Paint Data Section failed"); |
366 | if (length) |
366 | if (length) |
367 | *length = 0; |
367 | *length = 0; |
368 | if (!res) |
368 | if (!res) |
369 | return -PSICONV_E_NOMEM; |
369 | return -PSICONV_E_NOMEM; |
370 | else |
370 | else |
… | |
… | |
525 | ERROR3: |
525 | ERROR3: |
526 | psiconv_free_paint_data_section((*result)->picture); |
526 | psiconv_free_paint_data_section((*result)->picture); |
527 | ERROR2: |
527 | ERROR2: |
528 | free (*result); |
528 | free (*result); |
529 | ERROR1: |
529 | ERROR1: |
530 | psiconv_warn(config,lev+1,off,"Reading of Sketch Section failed"); |
530 | psiconv_error(config,lev+1,off,"Reading of Sketch Section failed"); |
531 | if (length) |
531 | if (length) |
532 | *length = 0; |
532 | *length = 0; |
533 | if (!res) |
533 | if (!res) |
534 | return -PSICONV_E_NOMEM; |
534 | return -PSICONV_E_NOMEM; |
535 | else |
535 | else |
… | |
… | |
628 | return 0; |
628 | return 0; |
629 | |
629 | |
630 | ERROR2: |
630 | ERROR2: |
631 | free (*result); |
631 | free (*result); |
632 | ERROR1: |
632 | ERROR1: |
633 | psiconv_warn(config,lev+1,off,"Reading of Font failed"); |
633 | psiconv_error(config,lev+1,off,"Reading of Font failed"); |
634 | if (length) |
634 | if (length) |
635 | *length = 0; |
635 | *length = 0; |
636 | if (!res) |
636 | if (!res) |
637 | return -PSICONV_E_NOMEM; |
637 | return -PSICONV_E_NOMEM; |
638 | else |
638 | else |
… | |
… | |
689 | return 0; |
689 | return 0; |
690 | |
690 | |
691 | ERROR2: |
691 | ERROR2: |
692 | psiconv_list_free(*decoded); |
692 | psiconv_list_free(*decoded); |
693 | ERROR1: |
693 | ERROR1: |
694 | psiconv_warn(config,lev+1,off,"Decoding of RLE8 failed"); |
694 | psiconv_error(config,lev+1,off,"Decoding of RLE8 failed"); |
695 | if (!res) |
695 | if (!res) |
696 | return -PSICONV_E_NOMEM; |
696 | return -PSICONV_E_NOMEM; |
697 | else |
697 | else |
698 | return res; |
698 | return res; |
699 | } |
699 | } |
… | |
… | |
732 | return 0; |
732 | return 0; |
733 | |
733 | |
734 | ERROR2: |
734 | ERROR2: |
735 | psiconv_list_free(*decoded); |
735 | psiconv_list_free(*decoded); |
736 | ERROR1: |
736 | ERROR1: |
737 | psiconv_warn(config,lev+1,off,"Decoding of RLE12 failed"); |
737 | psiconv_error(config,lev+1,off,"Decoding of RLE12 failed"); |
738 | if (!res) |
738 | if (!res) |
739 | return -PSICONV_E_NOMEM; |
739 | return -PSICONV_E_NOMEM; |
740 | else |
740 | else |
741 | return res; |
741 | return res; |
742 | } |
742 | } |
… | |
… | |
798 | return 0; |
798 | return 0; |
799 | |
799 | |
800 | ERROR2: |
800 | ERROR2: |
801 | psiconv_list_free(*decoded); |
801 | psiconv_list_free(*decoded); |
802 | ERROR1: |
802 | ERROR1: |
803 | psiconv_warn(config,lev+1,off,"Decoding of RLE16 failed"); |
803 | psiconv_error(config,lev+1,off,"Decoding of RLE16 failed"); |
804 | if (!res) |
804 | if (!res) |
805 | return -PSICONV_E_NOMEM; |
805 | return -PSICONV_E_NOMEM; |
806 | else |
806 | else |
807 | return res; |
807 | return res; |
808 | } |
808 | } |
… | |
… | |
868 | return 0; |
868 | return 0; |
869 | |
869 | |
870 | ERROR2: |
870 | ERROR2: |
871 | psiconv_list_free(*decoded); |
871 | psiconv_list_free(*decoded); |
872 | ERROR1: |
872 | ERROR1: |
873 | psiconv_warn(config,lev+1,off,"Decoding of RLE24 failed"); |
873 | psiconv_error(config,lev+1,off,"Decoding of RLE24 failed"); |
874 | if (!res) |
874 | if (!res) |
875 | return -PSICONV_E_NOMEM; |
875 | return -PSICONV_E_NOMEM; |
876 | else |
876 | else |
877 | return res; |
877 | return res; |
878 | } |
878 | } |
… | |
… | |
935 | |
935 | |
936 | |
936 | |
937 | ERROR2: |
937 | ERROR2: |
938 | psiconv_list_free(*pixels); |
938 | psiconv_list_free(*pixels); |
939 | ERROR1: |
939 | ERROR1: |
940 | psiconv_warn(config,lev+1,off,"Converting bytes to pixels failed"); |
940 | psiconv_error(config,lev+1,off,"Converting bytes to pixels failed"); |
941 | if (!res) |
941 | if (!res) |
942 | return -PSICONV_E_NOMEM; |
942 | return -PSICONV_E_NOMEM; |
943 | else |
943 | else |
944 | return res; |
944 | return res; |
945 | } |
945 | } |
… | |
… | |
1009 | ERROR3: |
1009 | ERROR3: |
1010 | free((*floats).green); |
1010 | free((*floats).green); |
1011 | ERROR2: |
1011 | ERROR2: |
1012 | free((*floats).red); |
1012 | free((*floats).red); |
1013 | ERROR1: |
1013 | ERROR1: |
1014 | psiconv_warn(config,lev+1,off,"Converting pixels to floats failed"); |
1014 | psiconv_error(config,lev+1,off,"Converting pixels to floats failed"); |
1015 | if (!res) |
1015 | if (!res) |
1016 | return -PSICONV_E_NOMEM; |
1016 | return -PSICONV_E_NOMEM; |
1017 | else |
1017 | else |
1018 | return res; |
1018 | return res; |
1019 | } |
1019 | } |