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

Michael Niedermayer michaelni
Fri Apr 23 02:40:16 CEST 2010


On Thu, Apr 22, 2010 at 01:46:49PM -0700, Baptiste Coudurier wrote:
> On 04/21/2010 05:12 PM, Michael Niedermayer wrote:
>> 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
>
> Agree, however this function is called by frame so it will spoil stderr :/

hmm urhm argh

      if(s->avctx->thread_count<  1){
          av_log(avctx, AV_LOG_ERROR, "automatic thread number detection not supported by codec, patch welcome\n");
          s->avctx->thread_count= 1;
      }

?

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

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- 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/20100423/fbacab09/attachment.pgp>



More information about the ffmpeg-devel mailing list