Bug 136823

Summary: libdv-0.104-4: undefined C code
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Gerd Hoffmann <kraxel>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-12-03 12:55:07 UTC
I just tried to compile package libdv-0.104-4 with a prerelease of the
GNU C compiler version 4.1. It said

1.

encode.c:1811: warning: operation on "i" may be undefined

The source code is

                for (i = 0;
                        i < (DV_WIDTH * (dv_enc->isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT));
                        dv_enc->img_y[i] = CLAMP(dv_enc->img_y[i++], -224, 214) );

I agree with the compiler - this code seems to be undefined.
Suggest new code

                for (i = 0;
                        i < (DV_WIDTH * (dv_enc->isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT));
                        (dv_enc->img_y[ i] = CLAMP( dv_enc->img_y[i], -224, 214)), ++i );

BTW, the email address of the author is broken [ omega@cse.ogi.edu ]
Comment 1 Ales Nosek 2006-09-20 14:47:19 UTC
Thank you for the report. The problem is fixed in Factory.