[haiku-commits] Re: r40800 - haiku/trunk/src/add-ons/translators/raw

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 04 Mar 2011 19:19:55 +0100

Ryan Leavengood <leavengood@xxxxxxxxx> wrote:
> On Fri, Mar 4, 2011 at 2:53 AM, Ingo Weinhold <ingo_weinhold@xxxxxx> 
> wrote:
> > * fError is a status_t. It should not be assigned a ssize_t value. 
> > This is
> > not only for aesthetical reasons: On 64 bit architectures ssize_t 
> > is
> > actually wider than status_t.
> Again, a problem which existed before. I suppose you have never looked
> at this code before (me neither.)

It doesn't matter if this code has been changed; code review shouldn't 
be restricted to the lines that changed -- every other pair of eyes on 
existing code may prove very useful.

> > * Obviously the code expects size(T) bytes of data. The case that 
> > less than
> > that is read is silently ignored and the caller is left with partial 
> > (or
> > since this change even) complete garbage.
> Before this change a particular JPEG file could not be opened and
> after it can. So reading 0 bytes can happen in real life.

Well, it might, but investigating the issue certainly makes sense.

I don't remember if I just copied that code from somewhere, or if I 
even wrote it myself - but I agree with Ingo that it's rather poor :-)
I just wonder why changing something in the RAW decoder makes a JPEG 
file readable.


Other related posts: