]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v410enc.c
flvdec: Fix compiler warning for uninitialized variables
[ffmpeg] / libavcodec / v410enc.c
index 1e600c35b6b8c93549dbe55e70039e544d3fb7a5..11c6abc88e1f3ed2d35e50ac70d36fa0dcd3de79 100644 (file)
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
-#include "put_bits.h"
 
 static av_cold int v410_encode_init(AVCodecContext *avctx)
 {
@@ -50,7 +50,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
     int i, j;
     int output_size = 0;
 
-    if (buf_size < avctx->width * avctx->height * 3) {
+    if (buf_size < avctx->width * avctx->height * 4) {
         av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
         return AVERROR(ENOMEM);
     }
@@ -67,7 +67,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
         for (j = 0; j < avctx->width; j++) {
             val  = u[j] << 2;
             val |= y[j] << 12;
-            val |= v[j] << 22;
+            val |= (uint32_t) v[j] << 22;
             AV_WL32(dst, val);
             dst += 4;
             output_size += 4;