Re: [E-devel] E SVN: illogict IN trunk/ethumb: . src/lib src/lib/client
On Sun, Sep 19, 2010 at 2:07 PM, Enlightenment SVN no-re...@enlightenment.org wrote: + if (e-orientation == ETHUMB_THUMB_ORIENT_ORIGINAL) + { +#ifdef HAVE_LIBEXIF + ExifData *exif = exif_data_new_from_file(e-src_path); + ExifEntry *entry = NULL; + ExifByteOrder bo; + int o; Missing initialization... If entry is null below, you'll use an initialized var. + + if (exif) + { + entry = exif_data_get_entry(exif, EXIF_TAG_ORIENTATION); + if (entry) You might want to jump on !entry, howeve. + { + bo = exif_data_get_byte_order(exif); + o = exif_get_short(entry-data, bo); + } + exif_data_free(exif); + switch (o) Here is the possible case of unitialized use of o. Lucas De Marchi -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: illogict IN trunk/ethumb: . src/lib src/lib/client
On Mon, Sep 20, 2010 at 8:11 AM, Lucas De Marchi lucas.demar...@profusion.mobi wrote: On Sun, Sep 19, 2010 at 2:07 PM, Enlightenment SVN no-re...@enlightenment.org wrote: + if (e-orientation == ETHUMB_THUMB_ORIENT_ORIGINAL) + { +#ifdef HAVE_LIBEXIF + ExifData *exif = exif_data_new_from_file(e-src_path); + ExifEntry *entry = NULL; + ExifByteOrder bo; + int o; Missing initialization... If entry is null below, you'll use an initialized var. + + if (exif) + { + entry = exif_data_get_entry(exif, EXIF_TAG_ORIENTATION); + if (entry) You might want to jump on !entry, howeve. + { + bo = exif_data_get_byte_order(exif); + o = exif_get_short(entry-data, bo); + } + exif_data_free(exif); + switch (o) Here is the possible case of unitialized use of o. BTW, exif parser is super-simple, as we just need a single case I'd rather have it in ethumb instead of linking with libexif. You can freely copy and adapt my code from http://git.profusion.mobi/cgit.cgi/lightmediascanner.git/tree/src/plugins/jpeg/jpeg.c just remove all the cases not used by that and you'll see how short it is. Note: last time i checked most exif parser libraries allocated, copied and then parsed the whole exif header... that usually contains a thumbnail! Then you end allocating, read and then parse around 50kb to get 2 bytes :-( -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: illogict IN trunk/ethumb: . src/lib src/lib/client
Hello! Lucas De Marchi lucas.demar...@profusion.mobi a écrit : On Sun, Sep 19, 2010 at 2:07 PM, Enlightenment SVN no-re...@enlightenment.org wrote: + if (e-orientation == ETHUMB_THUMB_ORIENT_ORIGINAL) + { +#ifdef HAVE_LIBEXIF + ExifData *exif = exif_data_new_from_file(e-src_path); + ExifEntry *entry = NULL; + ExifByteOrder bo; + int o; Missing initialization... If entry is null below, you'll use an initialized var. Thanks! Didn't see that one. + + if (exif) + { + entry = exif_data_get_entry(exif, EXIF_TAG_ORIENTATION); + if (entry) You might want to jump on !entry, howeve. We still want to free exif, so I'd say it's fine as it is. + { + bo = exif_data_get_byte_order(exif); + o = exif_get_short(entry-data, bo); + } + exif_data_free(exif); + switch (o) Here is the possible case of unitialized use of o. Lucas De Marchi Thank you :) Cheers! Chidambar -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: illogict IN trunk/ethumb: . src/lib src/lib/client
Hello! Gustavo Sverzut Barbieri barbi...@profusion.mobi a écrit : BTW, exif parser is super-simple, as we just need a single case I'd rather have it in ethumb instead of linking with libexif. You can freely copy and adapt my code from http://git.profusion.mobi/cgit.cgi/lightmediascanner.git/tree/src/plugins/jpeg/jpeg.c just remove all the cases not used by that and you'll see how short it is. Note: last time i checked most exif parser libraries allocated, copied and then parsed the whole exif header... that usually contains a thumbnail! Then you end allocating, read and then parse around 50kb to get 2 bytes :-( Thank you, I'll have a look at it :) Cheers! Chidambar -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel