On Thu, 28 Jan 2016 at 17:33 Luca Barbato <[email protected]> wrote:
> On 20/01/16 20:49, Vittorio Giovara wrote:
> > Right now only x264 info is printed at verbose level, anything else
> > is printed at trace level.
> > ---
> > libavcodec/h264_sei.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
> > index 1fb1fc5..62c7f73 100644
> > --- a/libavcodec/h264_sei.c
> > +++ b/libavcodec/h264_sei.c
> > @@ -217,6 +217,10 @@ static int
> decode_unregistered_user_data(H264Context *h, int size)
> > {
> > uint8_t *user_data;
> > int e, build, i;
> > + const uint8_t x264_uuid[16] = {
> > + 0xdc, 0x45, 0xe9, 0xbd, 0xe6, 0xd9, 0x48, 0xb7,
> > + 0x96, 0x2c, 0xd8, 0x20, 0xd9, 0x23, 0xee, 0xef,
> > + };
> >
> > if (size < 16 || size >= INT_MAX - 16)
> > return AVERROR_INVALIDDATA;
> > @@ -233,8 +237,13 @@ static int
> decode_unregistered_user_data(H264Context *h, int size)
> > if (e == 1 && build > 0)
> > h->x264_build = build;
> >
> > - if (strlen(user_data + 16) > 0)
> > - av_log(h->avctx, AV_LOG_DEBUG, "user data:\"%s\"\n", user_data
> + 16);
> > + /* Print x264 info at verbose level, everything else only at trace
> level */
> > + if (strlen(user_data + 16) > 0) {
> > + int loglevel = AV_LOG_TRACE;
> > + if (!memcmp(user_data, x264_uuid, sizeof(x264_uuid)))
> > + loglevel = AV_LOG_VERBOSE;
> > + av_log(h->avctx, loglevel, "user data:\"%s\"\n", user_data +
> 16);
> > + }
> >
> > av_free(user_data);
> > return 0;
> >
>
> Ok.
>
>
Clearly not ok since you can't guarantee this data is valid at all.
Kieran
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel