lavc: fix get_buffer() compatibility layer for audio.
authorAnton Khirnov <anton@khirnov.net>
Sun, 10 Mar 2013 16:56:35 +0000 (17:56 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sun, 10 Mar 2013 21:19:52 +0000 (22:19 +0100)
planes - FF_ARRAY_ELEMS would be evaluated as unsigned and underflow
instead of being negative as was intended.

libavcodec/utils.c

index 13efea4..0106b91 100644 (file)
@@ -687,7 +687,7 @@ do {                                                                    \
             for (i = 0; i < FFMIN(planes, FF_ARRAY_ELEMS(frame->buf)); i++)
                 WRAP_PLANE(frame->buf[i], frame->extended_data[i], frame->linesize[0]);
 
-            for (i = 0; i < planes - FF_ARRAY_ELEMS(frame->buf); i++)
+            for (i = 0; i < frame->nb_extended_buf; i++)
                 WRAP_PLANE(frame->extended_buf[i],
                            frame->extended_data[i + FF_ARRAY_ELEMS(frame->buf)],
                            frame->linesize[0]);