On Fri, Jun 08, 2018 at 04:47:05PM +0100, Derek Buitenhuis wrote: > Some of these enums have gaps in between their values, since they correspond > to the values in various specs, instead of being an incrementing list. > > Fixes segfaults when, for example, using the valid API call: > > av_color_primaries_from_name("jecdec-p22"); > > Signed-off-by: Derek Buitenhuis <derek.buitenh...@gmail.com> > --- > libavutil/pixdesc.c | 35 ++++++++++++++++++++++++++++++----- > 1 file changed, 30 insertions(+), 5 deletions(-) > > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c > index ff5c20d50e..f849222aa3 100644 > --- a/libavutil/pixdesc.c > +++ b/libavutil/pixdesc.c > @@ -2718,7 +2718,12 @@ int av_color_range_from_name(const char *name) > int i; > > for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) { > - size_t len = strlen(color_range_names[i]); > + size_t len; > + > + if (!color_range_names[i]) > + continue; > + > + len = strlen(color_range_names[i]); > if (!strncmp(color_range_names[i], name, len)) > return i; > }
theres no hole in color_range_names this may lead to static analyzers complaining about dead code [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel