Opened 10 years ago

Closed 10 years ago

#1216 closed defect (fixed)

Changes to TComSlice.h required in order to compile with GCC 4.8.1

Reported by: yetish Owned by:
Priority: minor Milestone: HM-13.0
Component: HM Version: HM-12.1
Keywords: GCC 4.8.1, TComSlice.h Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

Minor Bug

Changes to TComSlice.h required in order to compile with GCC 4.8.1

When compiling with GCC 4.8.1 TComSlice.h is flagged up multiple times with a single compiler error ("array subscript is above array bounds").

In effect, the compiler does not like it that tLayer (or tlayer is is called elsewhere) is assumed to be valid, it could be abused and thus unsafe.

To resolve this fear, test tLayer against getMaxTLayers to decide if it is safe prior to accepting or reverting to the maximum possible value. e.g.

m_numReorderPics[(tLayer = tLayer > getMaxTLayers ()? getMaxTLayers () : tLayer)] = v;

Making the following modifications will suppress these errors and the codebase will compile.

-------------
Around Line 450
Change from

Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; }

To

Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[(tLayer = tLayer > getMaxTLayers ()? getMaxTLayers () : tLayer)] = v; }

Change from

Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; }
Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[(tLayer = tLayer > getMaxTLayers ()? getMaxTLayers () : tLayer)] = v; }

Change from

Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; }

To

Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[(tLayer = tLayer > getMaxTLayers ()? getMaxTLayers () : tLayer)] = v; }

-------------

-------------
Around Line 820
Change from
Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; }
To

Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[(tlayer = tlayer > getMaxTLayers ()? getMaxTLayers () : tlayer)] = i; }


Change from

Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; }

To

Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[(tlayer = tlayer > getMaxTLayers ()? getMaxTLayers () : tlayer)] = ui; }

Change from

Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; }

To

Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[(tlayer = tlayer > getMaxTLayers ()? getMaxTLayers () : tlayer)] = ui; }

-------------

Change History (3)

comment:1 Changed 10 years ago by DefaultCC Plugin

  • Cc fbossen ksuehring davidf jct-vc@… added

comment:2 Changed 10 years ago by fbossen

Fixed in r3760

comment:3 Changed 10 years ago by fbossen

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Subscriber)
  • Frank Bossen(Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Always)
  • Yetish Joshi(Reporter)