On Tue, Jan 05, 2016 at 12:48:10PM +0100, Andreas Cadhalpun wrote: > On 05.01.2016 12:18, Michael Niedermayer wrote: > > On Tue, Jan 05, 2016 at 12:02:29PM +0100, Andreas Cadhalpun wrote: > >> That wouldn't work, as the codec id wasn't changed in force_codec_ids, > >> but in the API using program. > >> To reiterate, the problematic steps were: > >> * call avformat_find_stream_info, which detects a codec and initializes > >> a parser for it > >> * afterwards change the codec id in the API using program, so it > >> doesn't match with the parser > >> > >> Thus I think the only reliable way to detect this is a check in > >> av_parser_parse2. > > > > shouldnt this be a av_assert1/2() then ? > > i mean this is a programming error in the user app not a error > > condition that should happen that way in correct usage > > IMHO if we need 5 extra checks thats fine but if this is just to > > detect a user app bug then iam not sure these checks should be run > > for every packet > > I would prefer av_assert0, but if you think that could cause relevant > slowdowns, > I'm also fine with av_assert1. Patch for that attached. > > Best regards, > Andreas >
> parser.c | 7 +++++++ > 1 file changed, 7 insertions(+) > 1a29aebd63e39c82039cddb1239de415b1da43df > 0001-parser-add-av_assert1-to-make-sure-the-codec-matches.patch > From 80f6baa6d091807538461bab28656e3cf7303a2d Mon Sep 17 00:00:00 2001 > From: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> > Date: Mon, 4 Jan 2016 23:52:20 +0100 > Subject: [PATCH] parser: add av_assert1 to make sure the codec matches > > Otherwise this can have some surprising effects (crashes), so let's > better not allow it. > > Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel