[FFmpeg-trac] #11571(undetermined:new): Bug: Unexpected buffer overwrite incurred by ffmpeg command
FFmpeg
trac at avcodec.org
Fri May 2 07:29:52 EEST 2025
#11571: Bug: Unexpected buffer overwrite incurred by ffmpeg command
--------------------------------------+----------------------------------
Reporter: Jimmy Leung | Type: defect
Status: new | Priority: normal
Component: undetermined | Version: 7.1
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
--------------------------------------+----------------------------------
== Summary of the bug:
As the ticket title suggests, I find that ffmpeg is overwriting my other
shell buffers.
== Environment
ffmpeg version 7.1.1
macos 15.3.2
== How to reproduce:
Below is the script that can reproduce the bug.
{{{
#!/bin/sh
set -e
# Or use another other short-enough video to speed up the testing
vid="https://github.com/tsoding/musializer/assets/165283/8b9f9653-9b3d-
4c04-9569-338fa19af071"
folder=./temp
_index=0
mkdir -p $folder
echo "$vid\n$vid\n$vid\n$vid\n$vid" \
| while read -r vid_item;
do
echo "vid@$_index: $vid_item"
ffmpeg -hide_banner -loglevel error -c copy "$folder/${_index}.mp4" -i
$vid_item
_index=$((_index+1));
done
}}}
Apparently the `$vid_item` buffer is overwritten based on command output.
{{{
vid at 0: https://github.com/tsoding/musializer/assets/165283/8b9f9653-9b3d-
4c04-9569-338fa19af071
vid at 1: s://github.com/tsoding/musializer/assets/165283/8b9f9653-9b3d-
4c04-9569-338fa19af071
[in#0 @ 0x147e337a0] Error opening input: Protocol not found
}}}
And if I "patch" the ffmpeg command with `echo` & `xargs`, no such error
can be found.
{{{
echo $vid_item | xargs ffmpeg -hide_banner -loglevel error -c copy
"$folder/${_index}.mp4" -i
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11571>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list