[vlc-commits] vda: fix potential crash on empty buffer

Felix Paul Kühne git at videolan.org
Wed Jul 3 23:04:38 CEST 2013


vlc/vlc-2.1 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jul  3 23:02:54 2013 +0200| [954758a60753215eb4f15615afebc33ae2d94ff5] | committer: Felix Paul Kühne

vda: fix potential crash on empty buffer
(cherry picked from commit 7ee04e37aa78a944f82c846b90e1dbf8e4b1091e)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=954758a60753215eb4f15615afebc33ae2d94ff5
---

 modules/codec/avcodec/vda.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/avcodec/vda.c b/modules/codec/avcodec/vda.c
index f33001c..6235599 100644
--- a/modules/codec/avcodec/vda.c
+++ b/modules/codec/avcodec/vda.c
@@ -229,6 +229,11 @@ static int Extract( vlc_va_t *external, picture_t *p_picture, AVFrame *p_ff )
         msg_Dbg( p_va->p_log, "Frame buffer is empty.");
         return VLC_EGENERIC;
     }
+    if (!CVPixelBufferGetDataSize(cv_buffer) > 0)
+    {
+        msg_Dbg( p_va->p_log, "Empty frame buffer");
+        return VLC_EGENERIC;
+    }
 
     if( p_va->hw_ctx.cv_pix_fmt_type == kCVPixelFormatType_420YpCbCr8Planar )
     {



More information about the vlc-commits mailing list