[libav-devel] [PATCH 07/12] lavc: use buf[0] instead of data[0] as the indicator of an allocated frame

Anton Khirnov anton at khirnov.net
Fri Nov 29 20:52:06 CET 2013


data[0] may be NULL for valid frames with hwaccel pixel formats. This
argument currently applies to video only, but the change is also done
for audio to be consistent.
---
 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 37f4979..d1a1510 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1416,7 +1416,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
 
         emms_c(); //needed to avoid an emms_c() call before every return;
 
-        if (ret < 0 && picture->data[0])
+        if (ret < 0 && picture->buf[0])
             av_frame_unref(picture);
 
         if (*got_picture_ptr) {
-- 
1.7.10.4



More information about the libav-devel mailing list