From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/er: remove check for fields
Date: Mon, 3 Apr 2023 01:53:25 +0200
Message-ID: <20230402235325.GR1164690@pb2> (raw)
In-Reply-To: <058C3B7A-B6A9-4D61-965D-DD27B56DA81F@itanimul.li>
[-- Attachment #1.1: Type: text/plain, Size: 16208 bytes --]
On Mon, Mar 27, 2023 at 08:56:43AM +0200, J. Dekker wrote:
> On 23 Mar 2023, at 10:18, J. Dekker wrote:
>
> > This change on its own is almost certainly not correct; however, in
> > testing many samples show notable improvement.
> > ---
> >
> > The warning spams a bit when decoding using due to there being multiple
> > ERContexts used but it doesn't seem that excessive and it will be
> > removed soon (hopefully).
> >
> > libavcodec/error_resilience.c | 9 +++++++--
> > libavcodec/error_resilience.h | 1 +
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
>
> Pushed.
why was this pushed ?
the commit even says "This change on its own is almost certainly not correct;"
and in fact after this commit out of array reads and writes occurr
heres an example:
ffmpeg -y -i fate-suite/mpeg2/mpeg2_field_encoding.ts -i fate-suite/real/rv30.rm -r 30000/1001 -c:v:1 mpeg4 -map 0:0 -map 1:1 -c:v:0 mpeg2video test.avi
[mpeg2video @ 0x2d084040] Warning MVs not available
[mpeg2video @ 0x2d084040] concealing 90 DC, 90 AC, 90 MV errors in P frame
==15798== Invalid read of size 8
==15798== at 0xD81A2A: ??? (in ffmpeg_g)
==15798== Address 0x6071bc48 is 8 bytes inside a block of size 24 free'd
==15798== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x116332A: av_buffer_unref (in ffmpeg_g)
==15798== by 0x116F5B5: av_frame_unref (in ffmpeg_g)
==15798== by 0xFFC690: ff_mpeg_unref_picture (in ffmpeg_g)
==15798== by 0xA340B5: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798== Block was alloc'd at
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x117D3E8: av_mallocz (in ffmpeg_g)
==15798== by 0x11631C7: av_buffer_create (in ffmpeg_g)
==15798== by 0x8338CC: ff_attach_decode_data (in ffmpeg_g)
==15798== by 0x833AE4: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid read of size 8
==15798== at 0xD81A30: ??? (in ffmpeg_g)
==15798== Address 0x6071bf48 is 584 bytes inside a block of size 1,658 free'd
==15798== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x116333E: av_buffer_unref (in ffmpeg_g)
==15798== by 0x1163675: av_buffer_replace (in ffmpeg_g)
==15798== by 0xFFCEA0: ff_update_picture_tables (in ffmpeg_g)
==15798== by 0xFFD01A: ff_mpeg_ref_picture (in ffmpeg_g)
==15798== by 0xA34384: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798== Block was alloc'd at
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0xFFCB88: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid write of size 8
==15798== at 0xD81A79: ??? (in ffmpeg_g)
==15798== Address 0x6071bc48 is 8 bytes inside a block of size 24 free'd
==15798== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x116332A: av_buffer_unref (in ffmpeg_g)
==15798== by 0x116F5B5: av_frame_unref (in ffmpeg_g)
==15798== by 0xFFC690: ff_mpeg_unref_picture (in ffmpeg_g)
==15798== by 0xA340B5: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798== Block was alloc'd at
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x117D3E8: av_mallocz (in ffmpeg_g)
==15798== by 0x11631C7: av_buffer_create (in ffmpeg_g)
==15798== by 0x8338CC: ff_attach_decode_data (in ffmpeg_g)
==15798== by 0x833AE4: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid write of size 8
==15798== at 0xD81A8C: ??? (in ffmpeg_g)
==15798== Address 0x6071bf48 is 584 bytes inside a block of size 1,658 free'd
==15798== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x116333E: av_buffer_unref (in ffmpeg_g)
==15798== by 0x1163675: av_buffer_replace (in ffmpeg_g)
==15798== by 0xFFCEA0: ff_update_picture_tables (in ffmpeg_g)
==15798== by 0xFFD01A: ff_mpeg_ref_picture (in ffmpeg_g)
==15798== by 0xA34384: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798== Block was alloc'd at
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0xFFCB88: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid read of size 8
==15798== at 0xD81A08: ??? (in ffmpeg_g)
==15798== Address 0x606e4e90 is 1 bytes after a block of size 442,447 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0x1163AA4: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid write of size 8
==15798== at 0xD81A6B: ??? (in ffmpeg_g)
==15798== Address 0x606e4e90 is 1 bytes after a block of size 442,447 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0x1163AA4: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid write of size 8
==15798== at 0xD81A74: ??? (in ffmpeg_g)
==15798== Address 0x6071b688 is 110,664 bytes inside a block of size 110,671 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0x1163AA4: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid read of size 8
==15798== at 0xD81A1E: ??? (in ffmpeg_g)
==15798== Address 0x6071b698 is 9 bytes after a block of size 110,671 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x1163245: av_buffer_alloc (in ffmpeg_g)
==15798== by 0x11632BD: av_buffer_allocz (in ffmpeg_g)
==15798== by 0x1163AA4: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid read of size 8
==15798== at 0xD81A24: ??? (in ffmpeg_g)
==15798== Address 0x6071b998 is 0 bytes after a block of size 88 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x117D3E8: av_mallocz (in ffmpeg_g)
==15798== by 0x11639EB: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
==15798==
==15798== Invalid write of size 8
==15798== at 0xD81A87: ??? (in ffmpeg_g)
==15798== Address 0x6071b998 is 0 bytes after a block of size 88 alloc'd
==15798== at 0x4C33E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x4C33F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15798== by 0x117D232: av_malloc (in ffmpeg_g)
==15798== by 0x117D3E8: av_mallocz (in ffmpeg_g)
==15798== by 0x11639EB: av_buffer_pool_get (in ffmpeg_g)
==15798== by 0x8D80C4: avcodec_default_get_buffer2 (in ffmpeg_g)
==15798== by 0x833ACA: ff_get_buffer (in ffmpeg_g)
==15798== by 0xFFC832: ff_alloc_picture (in ffmpeg_g)
==15798== by 0xA34257: ff_mpv_frame_start (in ffmpeg_g)
==15798== by 0x9FC981: decode_chunks (in ffmpeg_g)
==15798== by 0x9FD024: mpeg_decode_frame (in ffmpeg_g)
==15798== by 0x8316BE: decode_receive_frame_internal (in ffmpeg_g)
==15798== by 0x83226F: avcodec_send_packet (in ffmpeg_g)
==15798== by 0x31B10B: decode_video (in ffmpeg_g)
==15798== by 0x31D048: transcode (in ffmpeg_g)
==15798== by 0x2EF743: main (in ffmpeg_g)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2023-04-02 23:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 9:18 J. Dekker
2023-03-23 10:05 ` Michael Niedermayer
2023-03-23 11:15 ` J. Dekker
2023-03-23 11:55 ` Michael Niedermayer
2023-03-27 6:56 ` J. Dekker
2023-04-02 23:53 ` Michael Niedermayer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230402235325.GR1164690@pb2 \
--to=michael@niedermayer.cc \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git