Do not fail in get_buffer_internal() if pix_fmt planes == 0.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 22 Mar 2013 00:03:07 +0000 (01:03 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 22 Mar 2013 00:03:07 +0000 (01:03 +0100)
Fixes VDPAU decoding, reported by Ilja Sekler

libavcodec/utils.c

index c15b772..70c6129 100644 (file)
@@ -758,6 +758,8 @@ do {                                                                    \
             const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
 
             planes = av_pix_fmt_count_planes(frame->format);
+            if (!planes)
+                planes = 1;
             if (!desc || planes <= 0) {
                 ret = AVERROR(EINVAL);
                 goto fail;