#8769: FFmpge crash when use VideoToolBox to encode frames
---------------------------------+--------------------------------------
             Reporter:  yxibng   |                     Type:  defect
               Status:  new      |                 Priority:  critical
            Component:  avcodec  |                  Version:  git-master
             Keywords:  crash    |               Blocked By:
             Blocking:           |  Reproduced by developer:  1
Analyzed by developer:  1        |
---------------------------------+--------------------------------------
 Summary of the bug:
 How to reproduce:
 {{{

 static void vtenc_output_callback(
     void *ctx,
     void *sourceFrameCtx,
     OSStatus status,
     VTEncodeInfoFlags flags,
     CMSampleBufferRef sample_buffer)
 {
     AVCodecContext *avctx = ctx;
     VTEncContext   *vtctx = avctx->priv_data;
     ExtraSEI *sei = sourceFrameCtx;

     if (vtctx->async_error) {
         if(sample_buffer) CFRelease(sample_buffer); //This line cause
 crash, should remove
         return;
     }

     if (status) {
         av_log(avctx, AV_LOG_ERROR, "Error encoding frame: %d\n",
 (int)status);
         set_async_error(vtctx, AVERROR_EXTERNAL);
         return;
     }

     if (!sample_buffer) {
         return;
     }

     if (!avctx->extradata && (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER))
 {
         int set_status = set_extradata(avctx, sample_buffer);
         if (set_status) {
             set_async_error(vtctx, set_status);
             return;
         }
     }

     vtenc_q_push(vtctx, sample_buffer, sei);
 }


 }}}
 Patches should be submitted to the ffmpeg-devel mailing list and not this
 bug tracker.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8769>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to