]> git.sesse.net Git - vlc/commitdiff
avcodec: missing error handling (refs #8792)
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 12 Jun 2013 17:22:54 +0000 (20:22 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 12 Jun 2013 17:22:54 +0000 (20:22 +0300)
modules/codec/avcodec/encoder.c

index 9523e325302b079f83599cd8ae84d418bf4e8a66..95b86a3f2a900b401b1875d1c00b4a9ccefb6c97 100644 (file)
@@ -926,6 +926,8 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
                          p_enc->fmt_out.video.i_bits_per_pixel / 8 : 3;
     const int blocksize = __MAX( FF_MIN_BUFFER_SIZE,bytesPerPixel * p_sys->p_context->height * p_sys->p_context->width + 200 );
     block_t *p_block = block_Alloc( blocksize );
+    if( unlikely(p_block == NULL) )
+        return NULL;
 
 #if (LIBAVCODEC_VERSION_MAJOR >= 54)
     AVPacket av_pkt;