|Anonymous | Login | Signup for a new account||2017-04-26 05:53 UTC|
|Main | My View | View Issues | Change Log | Roadmap | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0000545||[SkyOS 5.0 - Beta]||minor||always||2005-01-24 03:32||2005-01-26 11:23|
|Summary||0000545: Simple Image Viewer|
1) When launched, it seems the width and height are zero.
2) It can't load .ico files.
|Tags||No tags attached.|
|Reported for build|
|Fixed in build|
|Don't have the sources for this app. I guess "mike" has it.|
|the source for the applications is in the SkyOS forums. do a search for skymatch, and the thread is called "Source code for you!!!"|
edited on: 2005-01-26 01:15
Ah, didn't know it was by Mike, but I found it either way.
After reviewing the source, it looks like a simple C syntax bug, although my C skills are beginner at best. If I'm right, though, this still may affect SkyGI. This is how the window looks when I right clicked a bitmap and pressed 'view': http://www.i3x171um.com/sgi.jpg [^]
Reviewing the source, here is what I've come up with:
Line 169+170, imageview.c
int tempWidth = image->width;
int tempHeight = image->height;
The structure 'image' is defined by the return of GI_load_bitmap. He accesses the members of 'image' through a -> operator instead of a . operator, which would mean 'image' needed to be a pointer (which it's not). If image->width wasn't initialized to what it should be, this would cause the the program to pass who-knows-what to GI_set_dimension.
Now, ok, that's no big deal; it's someone's 200 line first program. The problem here is that GI_set_dimension is accepting it and drawing a window that looks like the above.
The only thing I see wrong with this theory is that the script obviously did compile. Either way, though, GI_set_dimension is allowed to draw something like that. GI_set_dimension (and possibly others) should be reviewed for a case when this could happen (like, say, if -1, -1 was passed).
Oh, look at that:
DIB *image = NULL;
Ok, I'm out of ideas. But at least you see the window I'm talking about. SkyOS shouldn't do that.
edited on: 01-26-05 01:15
>>Reviewing the source, here is what I've come up with:
>>Line 169+170, imageview.c
>> int tempWidth = image->width;
>> int tempHeight = image->height;
>>The structure 'image' is defined by the return of GI_load_bitmap. He accesses >>the members of 'image' through a -> operator instead of a . operator, which >>would mean 'image' needed to be a pointer (which it's not).
no, image must be a pointer to a DIB type.
>>If image->width wasn't initialized to what it should be, this would cause the >>the program to pass who-knows-what to GI_set_dimension.
Whenever image is valid (not null), width and height are valid too.
>> DIB *image = NULL;
This is correct too. One must do this to know "when" the image was loaded and is actually valid.
Nevertheless, bug fixed.
|2005-01-24 03:32||i3x171um||New Issue|
|2005-01-24 10:56||robert||Note Added: 0000343|
|2005-01-25 22:48||strestout_bugs||Note Added: 0000348|
|2005-01-26 00:50||i3x171um||Note Added: 0000351|
|2005-01-26 00:55||i3x171um||Note Edited: 0000351|
|2005-01-26 11:23||robert||Status||new => resolved|
|2005-01-26 11:23||robert||Resolution||open => fixed|
|2005-01-26 11:23||robert||Assigned To||=> robert|
|2005-01-26 11:23||robert||Note Added: 0000352|
|Mantis 1.1.4[^] Copyright © 2000 - 2008 Mantis Group|