Closed
Bug 623796
Opened 14 years ago
Closed 14 years ago
nsPNGDecoder.cpp:642:44: warning: passing NULL to non-pointer argument 2 of 'void MOZ_PNG_set_crc_action(png_struct*, int, int)'
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla2.0b11
People
(Reporter: dholbert, Assigned: glennrp+bmo)
References
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
942 bytes,
patch
|
joe
:
review+
joe
:
approval2.0+
|
Details | Diff | Splinter Review |
When building mozilla-central, I get this build warning:
> modules/libpr0n/decoders/nsPNGDecoder.cpp: In static member function 'static void mozilla::imagelib::nsPNGDecoder::info_callback(png_struct*, png_info*)':
> modules/libpr0n/decoders/nsPNGDecoder.cpp:642:44: warning: passing NULL to non-pointer argument 2 of 'void MOZ_PNG_set_crc_action(png_struct*, int, int)'
The chunk of code involved is:
===
>637 /* Reject any ancillary chunk after IDAT with a bad CRC (bug #397593).
>638 * It would be better to show the default frame (if one has already been
>639 * successfully decoded) before bailing, but it's simpler to just bail
>640 * out with an error message.
>641 */
>642 png_set_crc_action(png_ptr, NULL, PNG_CRC_ERROR_QUIT);
===
and it was added in bug 397593, as noted in the comment.
Presumably this was just a typo & we should be passing 0 instead of NULL as the second argument there...?
(or did the called function used to take a pointer whereas now it takes an integer?)
Reporter | ||
Comment 1•14 years ago
|
||
FWIW, this appears to be the only call to png_set_crc_action in all of mozilla-central, based on this search:
http://mxr.mozilla.org/mozilla-central/search?string=png_set_crc_action
Reporter | ||
Comment 2•14 years ago
|
||
(In reply to comment #0)
> Presumably this was just a typo & we should be passing 0 instead of NULL as the
> second argument there...?
or rather, presumably we should be passing PNG_CRC_DEFAULT, the PNG flag that corresponds to a "0"/NULL value in png.h...?
That is, assuming we want the crit_action==PNG_CRC_DEFAULT behavior in png_set_crc_action (which is the behavior that NULL is giving us right now):
>34 switch (crit_action)
...
>55 case PNG_CRC_DEFAULT:
>56 default:
>57 png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK;
>58 break;
Assignee | ||
Comment 3•14 years ago
|
||
crit_action is an int. The one we really want is PNG_CRC_NO_CHANGE, which
happens to be 5 (defined in png.h).
so: png_set_crc_action(png_ptr, PNG_CRC_NO_CHANGE, PNG_CRC_ERROR_QUIT);
since we have never changed the action from default, this would just leave it so,
without resetting the flag.
Status: NEW → ASSIGNED
Reporter | ||
Comment 4•14 years ago
|
||
(I'm assuming that your NEW --> ASSIGNED bug-status change indicated that you meant to assign it to yourself, so I'm adding you as the assignee. Feel free to revert if that's not correct.)
Assignee: nobody → glennrp+bmo
Assignee | ||
Comment 5•14 years ago
|
||
Yes that's what I intended. I'll prepare the (trivial) patch shortly.
Assignee | ||
Comment 6•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #501918 -
Flags: review?(joe)
Assignee | ||
Updated•14 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Updated•14 years ago
|
Attachment #501918 -
Flags: review?(joe) → review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•14 years ago
|
Attachment #501918 -
Flags: approval2.0?
Updated•14 years ago
|
Attachment #501918 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 8•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b11
You need to log in
before you can comment on or make changes to this bug.
Description
•