[FFmpeg-devel] [PATCH] Fix segv in mpeg* decoders with -threads 0

Michael Niedermayer michaelni
Thu Apr 22 02:12:31 CEST 2010


On Tue, Apr 20, 2010 at 04:29:55PM -0700, Baptiste Coudurier wrote:
> Hi
>
> $subject.
>
> -- 
> Baptiste COUDURIER
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> FFmpeg maintainer                                  http://www.ffmpeg.org

>  mpegvideo.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 1313ff9d938f0c4e67e2fc7934c120c0d89e8c11  threads_0_segv.patch
> Index: libavcodec/mpegvideo.c
> ===================================================================
> --- libavcodec/mpegvideo.c	(revision 22926)
> +++ libavcodec/mpegvideo.c	(working copy)
> @@ -655,7 +655,7 @@
>      s->context_initialized = 1;
>  
>      s->thread_context[0]= s;
> -    threads = s->avctx->thread_count;
> +    threads = FFMAX(1, s->avctx->thread_count);

we should do something similar to mpegvideo_enc.c
namely:
    if(s->avctx->thread_count < 1){
        av_log(avctx, AV_LOG_ERROR, "automatic thread number detection not supported by codec, patch welcome\n");
        return -1;
    }

that said, even better would be to implement the automatic detection

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100422/a08e17b1/attachment.pgp>



More information about the ffmpeg-devel mailing list