Opened 3 years ago

Closed 3 years ago

#9214 closed defect (duplicate)

ffmetadata decoding handles lines ending with backslashes incorrectly

Reported by: Michael Lelli Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: ffmetadata
Cc: Michael Lelli Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
In ffmetadata files, if a line ends with an escaped backslash the next line return is also escaped when it should not be. This only happens when using Unix newlines (\n). Using Windows newlines (\r\n) does not show this issue.

How to reproduce:
Create this ffmpeg tag file with Unix newlines:

;FFMETADATA1
test1=qwer\\
test2=asdf

Write, then read the metadata from a file:

ffmpeg -y -i in.mp4 -i meta.txt -map_metadata 1 -movflags use_metadata_tags -codec copy -f mp4 out.mp4

ffmpeg -i out.mp4 -f ffmetadata -

Expected results (and results with Windows newlines):

;FFMETADATA1
...
test1=qwer\\
test2=asdf

Actual results:

;FFMETADATA1
...
test1=qwer\\\
test2\=asdf

Version:

ffmpeg version 2021-05-02-git-5541cffa17-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint

Change History (1)

comment:1 by Michael Lelli, 3 years ago

Resolution: duplicate
Status: newclosed

Nevermind, appears to be a dup of #9144

Note: See TracTickets for help on using tickets.