Revision 29d2dc59

View differences:

libavcodec/mpegvideo.c
188 188
    const int b8_array_size= s->b8_stride*s->mb_height*2;
189 189
    const int b4_array_size= s->b4_stride*s->mb_height*4;
190 190
    int i;
191
    int r= -1;
191 192

  
192 193
    if(shared){
193 194
        assert(pic->data[0]);
194 195
        assert(pic->type == 0 || pic->type == FF_BUFFER_TYPE_SHARED);
195 196
        pic->type= FF_BUFFER_TYPE_SHARED;
196 197
    }else{
197
        int r;
198

  
199 198
        assert(!pic->data[0]);
200 199

  
201 200
        r= s->avctx->get_buffer(s->avctx, (AVFrame*)pic);
......
207 206

  
208 207
        if(s->linesize && (s->linesize != pic->linesize[0] || s->uvlinesize != pic->linesize[1])){
209 208
            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (stride changed)\n");
209
            s->avctx->release_buffer(s->avctx, (AVFrame*)pic);
210 210
            return -1;
211 211
        }
212 212

  
213 213
        if(pic->linesize[1] != pic->linesize[2]){
214 214
            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (uv stride mismatch)\n");
215
            s->avctx->release_buffer(s->avctx, (AVFrame*)pic);
215 216
            return -1;
216 217
        }
217 218

  
......
261 262

  
262 263
    return 0;
263 264
fail: //for the CHECKED_ALLOCZ macro
265
    if(r>=0)
266
        s->avctx->release_buffer(s->avctx, (AVFrame*)pic);
264 267
    return -1;
265 268
}
266 269

  

Also available in: Unified diff