Revision 432f1f11 libavcodec/rv34.c

View differences:

libavcodec/rv34.c
1396 1396
    }else
1397 1397
        slice_count = avctx->slice_count;
1398 1398

  
1399
    //parse first slice header to check whether this frame can be decoded
1400
    if(get_slice_offset(avctx, slices_hdr, 0) > buf_size){
1401
        av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n");
1402
        return -1;
1403
    }
1404
    init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), buf_size-get_slice_offset(avctx, slices_hdr, 0));
1405
    if(r->parse_slice_header(r, &r->s.gb, &si) < 0){
1406
        av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n");
1407
        return -1;
1408
    }
1409
    if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
1410
        return -1;
1411

  
1399 1412
    for(i=0; i<slice_count; i++){
1400 1413
        int offset= get_slice_offset(avctx, slices_hdr, i);
1401 1414
        int size;
......
1420 1433
            }else
1421 1434
                r->si.end = si.start;
1422 1435
        }
1423
        if(!i && si.type == FF_B_TYPE && (!s->last_picture_ptr || !s->last_picture_ptr->data[0]))
1424
            return -1;
1425 1436
        last = rv34_decode_slice(r, r->si.end, buf + offset, size);
1426 1437
        s->mb_num_left = r->s.mb_x + r->s.mb_y*r->s.mb_width - r->si.start;
1427 1438
        if(last)

Also available in: Unified diff