]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/imgconvert.c
Separate most of the per-block arrays into a separate per-block struct.
[ffmpeg] / libavcodec / imgconvert.c
index 165ba9ed8f4ef9dc4d27d1903aa0ad4302e9d672..6b0c049e2a532ce1b14e58bb7a6873b71bd78652 100644 (file)
@@ -813,9 +813,11 @@ void ff_shrink88(uint8_t *dst, int dst_wrap,
 int avpicture_alloc(AVPicture *picture,
                     enum PixelFormat pix_fmt, int width, int height)
 {
-    if (av_image_alloc(picture->data, picture->linesize, width, height, pix_fmt, 0) < 0) {
+    int ret;
+
+    if ((ret = av_image_alloc(picture->data, picture->linesize, width, height, pix_fmt, 1)) < 0) {
         memset(picture, 0, sizeof(AVPicture));
-        return -1;
+        return ret;
     }
 
     return 0;