msel-source / meflib

Multiscale Electrophysiology Format library
Other
3 stars 2 forks source link

Reference to uninitialized local pointer variable in video channels #14

Closed MaxvandenBoom closed 4 years ago

MaxvandenBoom commented 4 years ago

Hi Jan and Dan,

I encountered this issue upon compiling the meflib in VS2015. It applies only to the reading of video channels.

In the read_MEF_channel function (meflib.c) there is a reference to a variable which is uninitialized: bzero(ctmd->protected_region, METADATA_SECTION_3_PROTECTED_REGION_BYTES); (on line 5570)

Given the MEF 3 specification, the context (lines above and below) and the way it is done for the time-series channels, this should be: bzero(cmd3->protected_region, METADATA_SECTION_3_PROTECTED_REGION_BYTES); \ \ The exact same thing happens again for video-channels later on: bzero(stmd->protected_region, METADATA_SECTION_3_PROTECTED_REGION_BYTES); (on line 6268) which should be: bzero(smd3->protected_region, METADATA_SECTION_3_PROTECTED_REGION_BYTES); \ \ I might have another issue later, so I will combine them in one pull request to make it easy.

Best regards, Max

cimbi commented 4 years ago

Sounds good and thanks for spotting the bug. It is weird though. I did not have this bug in my local branch and git seemed not to notice the difference.

MaxvandenBoom commented 4 years ago

That is quite weird of git. Happy to help :)

cimbi commented 4 years ago

Fixed by PR #16