Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30'
[ffmpeg.git] / libavutil / frame.c
index 85d89b9..d5fd293 100644 (file)
@@ -181,6 +181,9 @@ static int get_video_buffer(AVFrame *frame, int align)
         return ret;
 
     if (!frame->linesize[0]) {
+        if (align <= 0)
+            align = 32; /* STRIDE_ALIGN. Should be av_cpu_max_align() */
+
         for(i=1; i<=align; i+=i) {
             ret = av_image_fill_linesizes(frame->linesize, frame->format,
                                           FFALIGN(frame->width, i));