[FFmpeg-trac] #9143(avformat:closed): libavformat:hlsenc split mpegts file failed if segment size >= INT_MAX/2

FFmpeg trac at avcodec.org
Wed Mar 10 00:26:03 EET 2021


#9143: libavformat:hlsenc split mpegts file failed if segment size >= INT_MAX/2
------------------------------------+------------------------------------
             Reporter:  hybase      |                    Owner:
                 Type:  defect      |                   Status:  closed
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:  invalid
             Keywords:  hls         |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------
Changes (by cehoyos):

 * keywords:  hlsenc mpegts => hls
 * status:  new => closed
 * resolution:   => invalid


Old description:

> Summary of the bug:
>
> 1) I always meet error when use '''ffmpeg 4.3.x''' to do hlsenc split big
> mpegts file if segment size > INT_MAX/2 because in '''dyn_buf_write()'''
> dyn_buffer size is limited with "if (new_size < d->pos || new_size >
> INT_MAX/2) {
>         av_log(NULL, AV_LOG_ERROR, "[dyn_buf_write] !=== failed, out of
> range, max support buffer_size=%u, but new_size= %u, d->pos= %d,
> buf_size= %d\n", INT_MAX/2, new_size, d->pos, buf_size);
>         return -1;
>     }"
> 2) it do well by old write file mechine in ffmpeg 4.1.x
> 3) Will this question be fixed in future plan?
>
> Thanks!
>
> details:
> {{{
> ffmpeg -y -fflags +genpts -loglevel verbose -i
> /r2/vppftp/miyuezhuan_01.ts\
>  -map 0:0 -c:v:0 copy -map 0:1 -c:a:0 copy\
>  -hls_time 1296 /r2/output/myz_part.m3u8
> '''(note: segment size need > INT_MAX/2)'''
> ffmpeg version (4.3.x)
> built on gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
> }}}

New description:

 Summary of the bug:

 1) I always meet error when use '''ffmpeg 4.3.x''' to do hlsenc split big
 mpegts file if segment size > INT_MAX/2 because in '''dyn_buf_write()'''
 dyn_buffer size is limited with
 {{{
     if (new_size < d->pos || new_size > INT_MAX/2) {
         av_log(NULL, AV_LOG_ERROR, "[dyn_buf_write] !=== failed, out of
 range, max support buffer_size=%u, but new_size= %u, d->pos= %d, buf_size=
 %d\n", INT_MAX/2, new_size, d->pos, buf_size);
         return -1;
     }
 }}}
 2) it do well by old write file mechine in ffmpeg 4.1.x
 3) Will this question be fixed in future plan?

 Thanks!

 details:
 {{{
 ffmpeg -y -fflags +genpts -loglevel verbose -i
 /r2/vppftp/miyuezhuan_01.ts\
  -map 0:0 -c:v:0 copy -map 0:1 -c:a:0 copy\
  -hls_time 1296 /r2/output/myz_part.m3u8
 '''(note: segment size need > INT_MAX/2)'''
 ffmpeg version (4.3.x)
 built on gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
 }}}

--

Comment:

 Please reopen this ticket if you can provide the command line you tested
 together with the complete, uncut console output and if the issue is
 reproducible with current FFmpeg git head (works for me).

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9143#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list