Merge branch 'fix-ffmpeg-decoding' into 'main'

ffmpeg: Fix crash on some media files

See merge request GNOME/gtk!4851
This commit is contained in:
Benjamin Otte 2022-07-04 21:27:11 +00:00
commit c673d7cd9b

View File

@ -292,9 +292,15 @@ gtk_ff_media_file_decode_frame (GtkFfMediaFile *video,
if (errnum >= 0)
{
errnum = avcodec_receive_frame (video->codec_ctx, frame);
if (errnum == AVERROR (EAGAIN))
{
// Just retry with the next packet
errnum = 0;
continue;
}
if (errnum < 0)
G_BREAKPOINT();
if (errnum >= 0)
else
{
av_packet_unref (&packet);
break;