[FFmpeg-devel] [PATCH]lavf/concatdec: Allocate the filenames on the heap

Marton Balint cus at passwd.hu
Sat Oct 21 23:38:58 EEST 2017

On Sat, 21 Oct 2017, Carl Eugen Hoyos wrote:

> 2017-10-21 18:29 GMT+02:00 Nicolas George <george at nsup.org>:
>> Le decadi 30 vendémiaire, an CCXXVI, Marton Balint a écrit :
>>> I thought filenames in libavformat are limited to 1K anyway
>>> because of the AVFormatContext->filename field.
> How can I reproduce this?
> I tested the data from the ticket from the command line
> and it worked fine here.
> Or is there maybe no limitation for the data protocol?

Okay, I checked the code, and libavformat opens the file with the original 
filename, not the truncated one which is stored in AVFormatContext, so the 
1024 character file name limit does not affect every use case.

>>> So if your patch really fixes the ticket, then how? :)
> So the original (and the attached) patch do not fix the
> ticket for you?
> Could you provide some console output to allow me to
> better understand the issue?

You cannot open for example an image sequence which has a path longer 
than 1024 bytes.

>> Yes, exactly. This limitation was the reason I did not bother handling
>> longer lines. I would like to understand how it makes a difference.
> New patch attached, please comment.

Like I said earlier, with only a little additional work you can eliminate 
the concat file name limit if you if you create a line reader function in 
avio which dynamically extends the available buffer, I think that is the 
better solution, because next time somebody will want 100k and not 50k.


More information about the ffmpeg-devel mailing list