[FFmpeg-devel] [PATCH v4 09/24] avcodec: add FF_CODEC_CAP_INIT_CLEANUP for all codecs which use ff_mpv_common_init()

lance.lmwang at gmail.com lance.lmwang at gmail.com
Wed Jun 3 17:17:16 EEST 2020


On Wed, Jun 03, 2020 at 12:43:34PM +0200, Michael Niedermayer wrote:
> On Tue, Jun 02, 2020 at 11:26:43PM +0800, lance.lmwang at gmail.com wrote:
> > From: Limin Wang <lance.lmwang at gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > ---
> >  libavcodec/h261dec.c       | 1 +
> >  libavcodec/h263dec.c       | 4 ++--
> >  libavcodec/mpeg12dec.c     | 9 ++++-----
> >  libavcodec/mpeg4videodec.c | 3 ++-
> >  libavcodec/mpegpicture.c   | 1 -
> >  libavcodec/mpegvideo.c     | 2 --
> >  libavcodec/msmpeg4dec.c    | 8 ++++----
> >  libavcodec/rv10.c          | 2 ++
> >  libavcodec/svq1enc.c       | 4 +---
> >  libavcodec/wmv2dec.c       | 1 +
> >  10 files changed, 17 insertions(+), 18 deletions(-)
> 
> this patch makes this
> ./ffmpeg -debug vis_qp  -i ~/videos/mm-short.mpg    -f framecrc -
> segfault
> 
> [mpeg2video @ 0x2d2df4c0] [Eval @ 0x1ffeffe940] Undefined constant or missing '(' in 'vis_qp'
> [mpeg2video @ 0x2d2df4c0] Unable to parse option value "vis_qp"
> [mpeg2video @ 0x2d2df4c0] Error setting option debug to value vis_qp.
> ==28696== Invalid read of size 4
> ==28696==    at 0x909059: ff_mpeg_unref_picture (in ffmpeg_g)
> ==28696==    by 0x90FC85: ff_mpv_common_end (in ffmpeg_g)
> ==28696==    by 0x27868C: mpeg_decode_end (in ffmpeg_g)
> ==28696==    by 0xA760F5: avcodec_open2 (in ffmpeg_g)
> ==28696==    by 0x2F4DB3: transcode_init (in ffmpeg_g)
> ==28696==    by 0x2F55F8: transcode (in ffmpeg_g)
> ==28696==    by 0x2D043B: main (in ffmpeg_g)
> ==28696==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
> 
> the video seems not to matter,
> if you cannot reproduce say so and ill provide more detailed debug information

Have fixed the dump, for mpeg_decode_init may failed,so I remove the s->mpeg_enc_ctx_allocated
checking in the mpeg_decode_end() to clean memory before failed, but it'll cause s->avctx
is NULL and it hasn't been checked in ff_mpv_common_end().


> 
> thx
> 
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list