Quoting Vittorio Giovara (2014-11-09 08:24:38)
> On Sat, Nov 8, 2014 at 8:18 AM, Luca Barbato <[email protected]> wrote:
> > On 08/11/14 08:10, Anton Khirnov wrote:
> >>>
> >>> I can AVERROR_BUG on the condition then.
> >>
> >>
> >> That is not a sustainable pattern. You could randomly insert checks for
> >> the validity of every possible parameter everywhere.
> >>
> >
> > In general I do agree, in this specific case could you have a second look
> > and think how to document at least so the caller won't do something stupid?
> 
> I've marked this as false positive, but I agree with Luca. Anton,
> would you be able to come up with the right wording at the right place
> to document this corner case?

I'm not sure what specifically is the "corner case" you're talking
about. In general, one should not fill structs with random data.

And specifically AVFrames are reset in avcodec_decode_*(), so the
proposed check would basically check for memory corruption inside
decoders.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to