# HG changeset patch # User reimar # Date 1234897289 0 # Node ID 679f41ece61616489f10e89576a62fd73152e820 # Parent 4cc1fbdaad5f9c1c9f7a831b28d6b0a0a169ba7c Make it possible for mpcodecs_get_image to return NULL as the documentation says it should instead of crashing. diff -r 4cc1fbdaad5f -r 679f41ece616 libmpcodecs/vd.c --- a/libmpcodecs/vd.c Tue Feb 17 18:59:47 2009 +0000 +++ b/libmpcodecs/vd.c Tue Feb 17 19:01:29 2009 +0000 @@ -341,7 +341,7 @@ // Note: buffer allocation may be moved to mpcodecs_config_vo() later... mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h){ mp_image_t* mpi=vf_get_image(sh->vfilter,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h); - mpi->x=mpi->y=0; + if (mpi) mpi->x=mpi->y=0; return mpi; }