[FFmpeg-devel] [PATCH] MpegEncContext must be initialized before calling ff_h263_decode_init

Reimar Döffinger Reimar.Doeffinger
Sat Jun 27 19:43:38 CEST 2009

On Sat, Jun 27, 2009 at 07:38:05PM +0300, Kostya wrote:
> On Sat, Jun 27, 2009 at 11:19:48AM +0200, Reimar D?ffinger wrote:
> > Hello,
> > ff_h263_decode_init calls MPV_common_init which then need mb_width to
> > calculate mb_stride.
> > So my conclusion is, MpegEncContext needs to be initialized before
> > calling this function.
> > This is probably what issue1233 is about.
> I've read issue 1233 and looks like the problem is with him not
> initializing codec properly - you should set width and height to
> real values before calling avcodec_open(), otherwise it's GIGO.

Yes, the documentation say so, but if the detection finds different
dimensions it will still crash, there is no way the application could
avoid that (except by parsing the VC1 stream itself).
Also, how does the VC1 decoder handle streams that change resolution
mid-stream? Because I have the suspicion that it's exactly the same
code that is needed for both cases...

More information about the ffmpeg-devel mailing list