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

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


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

vda: fix potential crash on empty buffer

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7ee04e37aa78a944f82c846b90e1dbf8e4b1091e
---

 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