From: "Joshua Eckstein" Newsgroups: comp.os.msdos.djgpp Subject: HELP! Unidentifiable error, may be null pointer bug Date: Tue, 22 Jul 1997 19:41:48 -0500 Organization: Flashnet Communications, http://www.flash.net Lines: 319 Message-ID: <5r3k0n$chb$1@excalibur.flash.net> NNTP-Posting-Host: dasc11-58.flash.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I have written a small program, below, that I'm trying to have fade in and out several PCX images. It seems to do fine with only one, but two it just can't handle! What is wrong? I've tried setting the _crt0 null ok flag, but that doesn't fix it. I've attached the header file I'm using, pcx.hpp, with this post. Just as not to confuse anyone, and for good measure, here are the descriptions of the header files I'm using: pcx.hpp: PCX routines vid.hpp: various video mode setting routines palfun.hpp: cool little palette functions, e.g., rotate palette, fade in from/to black, fade in from/to white, the palette setting functions, etc. (If you need any of these, e-mail me.... kwe1 AT flash DOT net) I've commented out the portions that I thought I could strip off the program to find out what was specifically causing the bug. It works fine with one picture, but not two.... ???? Please reply via kwe1 AT flash DOT net . And I've not even tried to do anything with the picture yet.... Call frame traceback: in function fgetc+20 pcx.cc(207) in function LoadPCXinfo__FPcP9PCXheaderP5COLOR pcx.cc(45) in function main in function __crt1_startup+138 #include #include /* Video Functions */ // #include I don't need to include it here, it's included with pcx.hpp #include #include /* for dosmemput */ void setpalzero () { int i; COLOR *temp; for (i = 0; i < 256; i++) temp[i].red = temp[i].gre = temp[i].blu = 0; SlamPal (temp); } void main () { setvideo(0x13); /*byte *waitpic = "wait.pcx"; byte *waitimg; COLOR *palw; PCXheader headw;*/ int wth, wth2; /*LoadPCXinfo(waitpic, &headw, palw); wth = (headw.xmax - headw.xmin + 1) * (headw.ymax - headw.ymin + 1); waitimg = malloc(wth); LoadPCX(waitpic, waitimg, &headw, palw, 1); setpalzero (); dosmemput (waitimg, 64000, 0xa0000); fromblack (palw);*/ byte *file1 = "art5.pcx", *file2 = "art3.pcx";//, *file3 = "art1.pcx"; byte *image1, *image2;//, *image3; COLOR *Pal1, *Pal2;//, *Pal3; PCXheader head1, head2;//, head3; LoadPCXinfo(file1, &head1, Pal1); wth = (head1.xmax - head1.xmin + 1) * (head1.ymax - head1.ymin + 1); image1 = malloc(wth); LoadPCXinfo(file2, &head2, Pal2); wth2 = (head2.xmax - head2.xmin + 1) * (head2.ymax - head2.ymin + 1); image2 = malloc(wth2); /*LoadPCXinfo(file3, &head3, Pal3); wth = (head3.xmax - head3.xmin + 1) * (head3.ymax - head3.ymin + 1); image3 = malloc(wth);*/ LoadPCX(file1, image1, &head1, Pal1, 0); LoadPCX(file2, image2, &head2, Pal2, 0); /*LoadPCX(file2, image2, &head2, Pal2, 0); LoadPCX(file3, image3, &head3, Pal3, 0); toblack (palw); free (waitimg);*/ setpalzero(); //remember to comment setpalzero when the bugs are gone dosmemput (image1, 64000, 0xa0000); //SlamPal(Pal1); fromblack(Pal1); delay (500); toblack(Pal1); /*dosmemput (image2, 64000, 0xa0000); SlamPal (Pal2); fromblack(Pal2); delay (100); toblack(Pal2); free (image1); free (image2); free (image3);*/ setvideo (0x03); } Please help me! This is my last resort... I've been troubleshooting this one program for about a week, and I have no idea what to do. Please reply by e-mail kwe1 AT flash DOT net . -Josh Eckstein, kwe1 AT flash DOT net begin 666 Pcx.hpp M(VEF;F1E9B!00U@-"B-D969I;F4 AT 4$-8#0H-"@T*+RH-"B @2&5R92=S('1H M92!H96%D97(@9FEL92!)('5S92!F;W(@4$-8(&9I;&5S+B @22=V92!T2!S971S M(&%L;" R-38 AT 8V]L;W)S+"!B=70@:7,@;F]T(&EN8VQU9&5D+@T*#0H-"B @ M3F]T92!T:&%T(")B>71E2P AT 22=V92!N979E7!E7,@,3 -"B @8VAA2H@("AX;6%X+7AM:6XK,2D-"B @&UA M>"P@>6UA>#L@(" @("\O('1H92!H96EG:'0@:7,@*G5S=6%L;'DJ(" H>6UA M>"UY;6EN*S$I#0H@('-H;W)T(&AO2 B<&%L971T92(-"B @3&]A9',@ M=&AE(%!#6"!H96%D97(@:6YF;R!I;G1O(")H96%D(@T**B\-"@T*:6YT($QO M86100U AT H8VAAPT*("!I M;G0@:3L-"B @:6YT('=I9'1H+"!H96EG:'0[#0H@(&EN="!C;W5N=#TP.R @ M(" @(" @(" O+R!C=7)R96YT('!I>&5L(&YU;6)EF5O9BA00UAH96%D97(I+" Q+"!F<"D[(" @(" @(" O+R!H96%D97(@:7,@ M,3(X(&)Y=&5S#0H-"@T*("!W:61T:" @/2!H96%D+3YX;6%X("T@:&5A9"T^ M>&UI;B K(#$[(" @(" @(" @+R\@:6UA9V4 AT 9&EM96YS:6]N6UI;B K(#$[#0H-"B @:68H M:&5A9"T^;6%N=69A8W1U3X^,CL-"B @("!K97D@(#T@(&9G971C M*&9P*3L-"B @("!P86QE='1E6VE=+F)L=2 ](&ME>3X^,CL-"B @?0T*("!I M9BAE;F%B;&5P86PI(%-L86U086PH<&%L971T92D[#0H-"B @9G-E96LH9G L M,3(X+%-%14M?4T54*3L-"@T*("!I9BAW:61T:"4R("8F('=I9'1H("$](&AE M860M/F)Y=&5S7W!EPT*(" @(&ME>3UF9V5T8RAF M<"D[(" @(" @(" @(" @(" O+R!G970 AT 82!C:&%R86-T97(-"B @("!I9BAK M97D^,3DQ*2 @(" @(" @(" @(" @(" @+R\@:68@/B Q.3$L(&ET(&ES(&$@ M71E2 M(#$Y,CL@(" @+R\@<&EX96QS(&EN('1H:7,@(G)U;B(@8V%N(&)E('5P M('1O(#8S#0H@(" @("!K97D@/2!F9V5T8RAF<"D[(" @(" @(" @("\O(&=E M="!T:&4 AT 8V]L;W(@=&\@<'5T(')E<&5A=&5D;'D-"@T*(" @(" @+R]4:&4@ M;F5X="!L:6YE(&]F(&-O9&4@&5L('9A;'5E('5N;&5S71EPT*(" @(" @(" @("ID97-T*RL@/2!K97D[#0H@ M(" @(" @(" @;G5M7V)Y=&5S+2T[#0H@(" @(" @('T-"B @(" @(" @8V]U M;G0K*SL-"B @(" @('T-"B @("!]#0H@(" @96QS90T*(" @('L-"B @(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