Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9143 closed defect (invalid)

libavformat:hlsenc split mpegts file failed if segment size >= INT_MAX/2

Reported by: hybase Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls regression
Cc: zymill@163.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

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)

Change History (4)

comment:1 by mkver, 4 years ago

Said limit has been increased to INT_MAX in fa0bc627c5d83f5d8c8f16dec3f46d8c66304488. Is this enough?

comment:2 by hybase, 4 years ago

I have try to enlarge it like this, but I meet av_reallocp(&d->buffer, new_allocated_size)) failed in dyn_buf_write() because the buffer size too big for mem alloc.

Last edited 4 years ago by hybase (previous) (diff)

comment:3 by Carl Eugen Hoyos, 4 years ago

Description: modified (diff)
Keywords: hls added; hlsenc mpegts removed
Resolution: invalid
Status: newclosed

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).

comment:4 by Carl Eugen Hoyos, 4 years ago

Keywords: regression added
Note: See TracTickets for help on using tickets.