[FFmpeg-devel] [PATCH] ATRAC3+ decoder, 2nd try

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Nov 19 19:05:44 CET 2013


On Tue, Nov 19, 2013 at 01:50:14PM +0100, Maxim Polijakowski wrote:
> >>+            if ((ret = decode_gainc_npoints(gb, ctx, ch_num, coded_subbands, avctx)   < 0) ||
> >>+                (ret = decode_gainc_levels(gb, ctx, ch_num, coded_subbands, avctx)    < 0) ||
> >>+                (ret = decode_gainc_loc_codes(gb, ctx, ch_num, coded_subbands, avctx) < 0))
> >this looks like its missing some ()
> 
> It actually doesn't do. Otherwise it won't compile....

I think you might have misunderstood.
You do
(ret = a < 0)
This means that ret will be either 0 or 1.
I'd expect you'd want ret to actually contain the error.
So you have to do
((ret = a) < 0)
Personally I still think it's a horrible idea in almost
all cases to put assignments inside ifs, it leads to errors
like these (of which Michael fixed what feels like hundreds
only recently).


More information about the ffmpeg-devel mailing list