[FFmpeg-trac] #9422(avformat:new): PMT descriptor overflow, results in incorrect streams
FFmpeg
trac at avcodec.org
Wed Sep 15 16:00:59 EEST 2021
#9422: PMT descriptor overflow, results in incorrect streams
-------------------------------------+-------------------------------------
Reporter: Nicolás | Owner: (none)
Jorge Dato |
Type: defect | Status: new
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: mpegts | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by Nicolás Jorge Dato:
Old description:
> Summary of the bug:
> I have a mpegts sample that a PMT's descriptor overflows resulting in
> incorrect streams. I wasn't able to connect to the FTP upload.ffmpeg.org
> server to send this sample. (What should I do?)
>
> In that sample, the PMT has a program_info_length of 12 bytes. First,
> there is a descriptor ID 5, 4 bytes long. Then, it appears like there is
> an ID 1 descriptor, 15 bytes long. This overflows the program_info_length
> of 12 bytes.
>
> I have found and fixed the issue in libavformat/mpegts.c, I'll send the
> patch to ffmpeg-devel mailing list.
>
> How to reproduce:
> {{{
> % ffprobe pmt_descriptor_overflow.ts
> ffprobe version N-103620-gbbc24363f1 Copyright (c) 2007-2021 the FFmpeg
> developers
> built with gcc 11.2.0 (GCC)
> configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
> --docdir=/usr/doc/ffmpeg-4.4/html --mandir=/usr/man --disable-debug
> --enable-shared --disable-static --enable-gpl --enable-version3
> --arch=x86_64 --enable-nonfree --disable-encoder=aac --enable-libfdk-aac
> --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-
> gnutls --enable-libbluray --enable-libcaca --enable-libcdio --enable-
> frei0r --enable-openal --enable-libopus --enable-libspeex --enable-libssh
> --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-
> libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-
> libx265 --enable-libmp3lame --enable-opencl --enable-opengl --enable-
> libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libxml2
> --enable-librsvg --enable-libdrm --enable-libsrt --enable-nvenc --enable-
> nvdec
> libavutil 57. 5.100 / 57. 5.100
> libavcodec 59. 7.103 / 59. 7.103
> libavformat 59. 5.100 / 59. 5.100
> libavdevice 59. 0.101 / 59. 0.101
> libavfilter 8. 9.100 / 8. 9.100
> libswscale 6. 1.100 / 6. 1.100
> libswresample 4. 0.100 / 4. 0.100
> libpostproc 56. 0.100 / 56. 0.100
> [mpegts @ 0xca9d00] PES packet size mismatch
> [mpegts @ 0xca9d00] Packet corrupt (stream = 1, dts = 3697332704).
> [mpegts @ 0xca9d00] PES packet size mismatch
> [mpegts @ 0xca9d00] Packet corrupt (stream = 1, dts = 3697332704).
> [mpegts @ 0xca9d00] Could not find codec parameters for stream 0
> (Unknown: none ([17][0][0][0] / 0x0011)): unknown codec
> Consider increasing the value for the 'analyzeduration' (0) and
> 'probesize' (5000000) options
> Input #0, mpegts, from 'pmt_descriptor_overflow.ts':
> Duration: 00:00:06.67, start: 41075.799822, bitrate: 2307 kb/s
> Program 1
> Stream #0:0[0x1014]: Unknown: none ([17][0][0][0] / 0x0011)
> No Program
> Stream #0:1[0x10f]: Audio: aac (LC), 48000 Hz, stereo, fltp, 95 kb/s
> Stream #0:2[0x1011]: Video: h264 (Main), yuv420p(tv,
> smpte170m/smpte170m/bt709, progressive), 720x576 [SAR 12:11 DAR 15:11],
> 50 fps, 50 tbr, 90k tbn
> Unsupported codec with id 0 for input stream 0
> }}}
>
> The stream #0:0 actually doesn't exists. Streams #0:1 and #0:2 are
> correct, however they should be inside Program 1, as those are registered
> in the PMT.
New description:
Summary of the bug:
I have a mpegts sample that a PMT's descriptor overflows resulting in
incorrect streams. ~~I wasn't able to connect to the FTP upload.ffmpeg.org
server to send this sample. (What should I do?)~~ I have attached the
sample to this ticket.
In that sample, the PMT has a program_info_length of 12 bytes. First,
there is a descriptor ID 5, 4 bytes long. Then, it appears like there is
an ID 1 descriptor, 15 bytes long. This overflows the program_info_length
of 12 bytes.
I have found and fixed the issue in libavformat/mpegts.c, I'll send the
patch to ffmpeg-devel mailing list: https://ffmpeg.org/pipermail/ffmpeg-
devel/2021-September/285355.html
How to reproduce:
{{{
% ffprobe pmt_descriptor_overflow.ts
ffprobe version N-103620-gbbc24363f1 Copyright (c) 2007-2021 the FFmpeg
developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
--docdir=/usr/doc/ffmpeg-4.4/html --mandir=/usr/man --disable-debug
--enable-shared --disable-static --enable-gpl --enable-version3
--arch=x86_64 --enable-nonfree --disable-encoder=aac --enable-libfdk-aac
--enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-
gnutls --enable-libbluray --enable-libcaca --enable-libcdio --enable-
frei0r --enable-openal --enable-libopus --enable-libspeex --enable-libssh
--enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis
--enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
--enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg
--enable-libpulse --enable-libsmbclient --enable-libxml2 --enable-librsvg
--enable-libdrm --enable-libsrt --enable-nvenc --enable-nvdec
libavutil 57. 5.100 / 57. 5.100
libavcodec 59. 7.103 / 59. 7.103
libavformat 59. 5.100 / 59. 5.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 9.100 / 8. 9.100
libswscale 6. 1.100 / 6. 1.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100
[mpegts @ 0xca9d00] PES packet size mismatch
[mpegts @ 0xca9d00] Packet corrupt (stream = 1, dts = 3697332704).
[mpegts @ 0xca9d00] PES packet size mismatch
[mpegts @ 0xca9d00] Packet corrupt (stream = 1, dts = 3697332704).
[mpegts @ 0xca9d00] Could not find codec parameters for stream 0 (Unknown:
none ([17][0][0][0] / 0x0011)): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and
'probesize' (5000000) options
Input #0, mpegts, from 'pmt_descriptor_overflow.ts':
Duration: 00:00:06.67, start: 41075.799822, bitrate: 2307 kb/s
Program 1
Stream #0:0[0x1014]: Unknown: none ([17][0][0][0] / 0x0011)
No Program
Stream #0:1[0x10f]: Audio: aac (LC), 48000 Hz, stereo, fltp, 95 kb/s
Stream #0:2[0x1011]: Video: h264 (Main), yuv420p(tv,
smpte170m/smpte170m/bt709, progressive), 720x576 [SAR 12:11 DAR 15:11], 50
fps, 50 tbr, 90k tbn
Unsupported codec with id 0 for input stream 0
}}}
The stream #0:0 actually doesn't exists. Streams #0:1 and #0:2 are
correct, however they should be inside Program 1, as those are registered
in the PMT.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9422#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list