[SCM] libav/experimental: Avoid segfaulting if the swscale context cannot be allocated

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:49:46 UTC 2013


The following commit has been merged in the experimental branch:
commit 0b50ac8a0f412ec4a933669163e19fc03c8a0e48
Author: Luca Abeni <lucabe72 at email.it>
Date:   Sat Aug 5 13:09:42 2006 +0000

    Avoid segfaulting if the swscale context cannot be allocated
    
    Originally committed as revision 5936 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/ffmpeg.c b/ffmpeg.c
index 022ebfe..f305dff 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1665,6 +1665,10 @@ static int av_encode(AVFormatContext **output_files,
                             codec->height - (frame_padtop + frame_padbottom),
                             codec->pix_fmt,
                             sws_flags, NULL, NULL, NULL);
+                    if (ost->img_resample_ctx == NULL) {
+                        fprintf(stderr, "Cannot get resampling context\n");
+                        exit(1);
+                    }
                     ost->resample_height = icodec->height - (frame_topBand + frame_bottomBand);
                 }
                 ost->encoding_needed = 1;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list