]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vc1dec.c
avcodec/atrac1: Cleanup generically after init failure
[ffmpeg] / libavcodec / vc1dec.c
index 0a059896352e75fc19abee5fa623c044379e5446..7809234ff79936061a08ce40b0fae190fa42ae19 100644 (file)
@@ -29,7 +29,7 @@
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "get_bits.h"
-#include "hwaccel.h"
+#include "hwconfig.h"
 #include "internal.h"
 #include "mpeg_er.h"
 #include "mpegvideo.h"
@@ -701,7 +701,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
                         goto err;
                     }
                     slices = tmp;
-                    slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
+                    slices[n_slices].buf = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
                     if (!slices[n_slices].buf) {
                         ret = AVERROR(ENOMEM);
                         goto err;
@@ -730,7 +730,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
                         goto err;
                     }
                     slices = tmp;
-                    slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
+                    slices[n_slices].buf = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
                     if (!slices[n_slices].buf) {
                         ret = AVERROR(ENOMEM);
                         goto err;
@@ -1038,7 +1038,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
 
         ff_mpeg_er_frame_start(s);
 
-        v->bits = FFMIN(buf_size * 8, s->gb.size_in_bits);
         v->end_mb_x = s->mb_width;
         if (v->field_mode) {
             s->current_picture.f->linesize[0] <<= 1;
@@ -1114,7 +1113,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
             ff_vc1_decode_blocks(v);
             if (i != n_slices) {
                 s->gb = slices[i].gb;
-                v->bits = FFMIN(buf_size * 8, s->gb.size_in_bits);
             }
         }
         if (v->field_mode) {