avcodec/g2meet: check framebuf has been allocated before use
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Jun 2013 00:29:35 +0000 (02:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Jun 2013 01:09:26 +0000 (03:09 +0200)
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/g2meet.c

index 51ec5bb..8eb310b 100644 (file)
@@ -759,7 +759,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
     if (got_header)
         c->got_header = 1;
 
-    if (c->width && c->height) {
+    if (c->width && c->height && c->framebuf) {
         if ((ret = ff_get_buffer(avctx, pic, 0)) < 0) {
             av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
             return ret;