JvanKatwijk / SDRunoPlugin_weatherfax

SDRuno_weatherfax plugin for SDRuno
8 stars 2 forks source link

Crashes in Windows 7 and add delete [] calls #3

Open LinuxSheeple-E opened 3 years ago

LinuxSheeple-E commented 3 years ago

I noticed the plugin crashes on my laptop using Windows 7. I sometimes get null pointer exceptions in Windows 10.

I traced the problem to SDRunoPlugin_faxForm.cpp. I added the following missing code line at line 133 and it fixed the problem: bmInfo_sett.bmiHeader.biCompression = BI_RGB;

I also suggest to add delete [] calls for the new allocations at the end of the Setup function. correctButton. tooltip ("use to correct the picture after picture completion"); delete[] borderPixels; delete[] innerPixels; delete[] closePixels; delete[] closeoverPixels; delete[] minPixels; delete[] minoverPixels; delete[] barPixels; delete[] barfocusedPixels; delete[] settPixels; delete[] settoverPixels; }

JvanKatwijk commented 3 years ago

Thanks, I am a Linux person, and just took the "example" plugin (I do not know anything about the windows environment or nana) In the plugin (and therefore my plugins), line 133 reads bmInfo_sett_over.bmiHeader.biCompression = BI_RGB; I assume that these modifications should be applied to my other plugins as well

One thing to notice: from W7 users I got the remark that the plugin could not be loaded. I made a test version where comdlg32.dll was not needed - and therefore the external dependencies were the same as fot the other plugins - and according to a tester that works fine.

Anyway, thanks

best jan

Op do 25 mrt. 2021 om 16:16 schreef Eric A. Cottrell < @.***>:

I noticed the plugin crashes on my laptop using Windows 7. I sometimes get null pointer exceptions in Windows 10.

I traced the problem to SDRunoPlugin_faxForm.cpp. I added the following missing code line at line 133 and it fixed the problem: bmInfo_sett.bmiHeader.biCompression = BI_RGB;

I also suggest to add delete [] calls for the new allocations at the end of the Setup function. correctButton. tooltip ("use to correct the picture after picture completion"); delete[] borderPixels; delete[] innerPixels; delete[] closePixels; delete[] closeoverPixels; delete[] minPixels; delete[] minoverPixels; delete[] barPixels; delete[] barfocusedPixels; delete[] settPixels; delete[] settoverPixels; }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/SDRuno_weatherfax/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQD3RYSQ56ZS3V4OVCDTFNHTHANCNFSM4ZZRYGGQ .

-- Jan van Katwijk

LinuxSheeple-E commented 3 years ago

Hello, This is what my code block looks like: bmInfo_bar.bmiHeader.biCompression = BI_RGB; bmInfo_sett.bmiHeader.biCompression = BI_RGB; bmInfo_sett_over.bmiHeader.biCompression = BI_RGB; borderHeader.bfOffBits = rawDataOffset;

I had problems loading the released plugin dll in Windows 7. There were several different exceptions thrown. It worked in Windows 10. The dll I compiled from source would sometimes work in Windows 7. I have seen bugs like these before, where changing the memory footprint, or operating system, exposes or covers up the problem. I am very fortunate to uncover it as they can be very difficult to find.

So you should check all your plugin projects and add the line if it is missing.

73 Eric

JvanKatwijk commented 3 years ago

Thanks,

I'll adapt my plugins. I understand you did not have a W7 problem that the plugin would not load?

jan

Op do 25 mrt. 2021 om 16:57 schreef Eric A. Cottrell < @.***>:

Hello, This is what my code block looks like: bmInfo_bar.bmiHeader.biCompression = BI_RGB; bmInfo_sett.bmiHeader.biCompression = BI_RGB; bmInfo_sett_over.bmiHeader.biCompression = BI_RGB; borderHeader.bfOffBits = rawDataOffset;

I had problems loading the released plugin dll in Windows 7. There were several different exceptions thrown. It worked in Windows 10. The dll I compiled from source would sometimes work in Windows 7. I have seen bugs like these before, where changing the memory footprint, or operating system, exposes or covers up the problem. I am very fortunate to uncover it as they can be very difficult to find.

73 Eric

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JvanKatwijk/SDRuno_weatherfax/issues/3#issuecomment-806995886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCPHQC3DZGG5FTOPFSFS4LTFNMNZANCNFSM4ZZRYGGQ .

-- Jan van Katwijk