]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avpicture.c
mpeg4videodec: move mpeg4-specific bug workaround variables from MpegEncContext to...
[ffmpeg] / libavcodec / avpicture.c
index ec4e748ac8a7aaab4c8a04f1a4c2bb9e2e5d3857..a50bbc497ffb8ab333b47973ffab154b5322a54b 100644 (file)
@@ -75,7 +75,7 @@ int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
         }
     }
 
-    if (desc->flags & PIX_FMT_PAL)
+    if (desc->flags & AV_PIX_FMT_FLAG_PAL)
         memcpy((unsigned char *)(((size_t)dest + 3) & ~3),
                src->data[1], 256 * 4);
 
@@ -88,9 +88,11 @@ int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
     AVPicture dummy_pict;
     int ret;
 
+    if (!desc)
+        return AVERROR(EINVAL);
     if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
         return ret;
-    if (desc->flags & PIX_FMT_PSEUDOPAL)
+    if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
         // do not include palette for these pseudo-paletted formats
         return width * height;
     return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);