[FFmpeg-devel] [PATCH 1/3] avcodec/qdm2: Do not read out of array in fix_coding_method_array()

Michael Niedermayer michael at niedermayer.cc
Mon Jul 8 10:43:45 EEST 2019


On Mon, Jun 24, 2019 at 02:09:57PM +0200, Moritz Barsnick wrote:
> On Mon, Jun 24, 2019 at 01:01:02 +0200, Michael Niedermayer wrote:
> > +                    if (sb + (j + k) / 64 > 29) {
> [...]
> >                      if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) {
> 
> You could do the "sb + (j + k) / 64]" calculation only once and reuse
> the result. OTOH, this code is full of magic numbers (notably 30, where
> your 29 derives from) which could nicely make use of macros, but don't,
> so it probably doesn't matter.

ill factor the value in a seperate variable and will apply

thanks


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190708/654e9cef/attachment.sig>


More information about the ffmpeg-devel mailing list