[FFmpeg-devel] Get rid of magic number in dsicinvideo.c

Clément Bœsch u at pkh.me
Mon Nov 23 17:03:44 CET 2015


On Tue, Nov 24, 2015 at 02:34:58AM +1100, Mohammad G wrote:
> Greetings,
> 
> File of interest is: libavcodec/dsicinvideo.c
> 
> Line 103:
> memcpy(huff_code_table, src, 15);
> 
> Magic number 15 triggers some source code analysis tools to detect it as a
> potential issue.
> 
> I'm requesting a change to:
> memcpy(huff_code_table, src, sizeof(huff_code_table));
> 
> Which is equivalent in functionality.
> 

Since this won't change a thing unless i'm mistaken, it's strange that the
static analyzer is complaining.

isn't the problem about the fact that it's reading 15 bytes from a source
buffer from which we don't check the length?


> Regards,
> Mohammad
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151123/a19cd9f7/attachment.sig>


More information about the ffmpeg-devel mailing list