mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-02 20:35:37 +02:00
rv40: Return more meaningful error codes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
parent
d617e77cec
commit
0f532fd3f9
@ -130,22 +130,23 @@ static int rv40_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
|
|||||||
int mb_bits;
|
int mb_bits;
|
||||||
int w = r->s.width, h = r->s.height;
|
int w = r->s.width, h = r->s.height;
|
||||||
int mb_size;
|
int mb_size;
|
||||||
|
int ret;
|
||||||
|
|
||||||
memset(si, 0, sizeof(SliceInfo));
|
memset(si, 0, sizeof(SliceInfo));
|
||||||
if(get_bits1(gb))
|
if(get_bits1(gb))
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
si->type = get_bits(gb, 2);
|
si->type = get_bits(gb, 2);
|
||||||
if(si->type == 1) si->type = 0;
|
if(si->type == 1) si->type = 0;
|
||||||
si->quant = get_bits(gb, 5);
|
si->quant = get_bits(gb, 5);
|
||||||
if(get_bits(gb, 2))
|
if(get_bits(gb, 2))
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
si->vlc_set = get_bits(gb, 2);
|
si->vlc_set = get_bits(gb, 2);
|
||||||
skip_bits1(gb);
|
skip_bits1(gb);
|
||||||
si->pts = get_bits(gb, 13);
|
si->pts = get_bits(gb, 13);
|
||||||
if(!si->type || !get_bits1(gb))
|
if(!si->type || !get_bits1(gb))
|
||||||
rv40_parse_picture_size(gb, &w, &h);
|
rv40_parse_picture_size(gb, &w, &h);
|
||||||
if(av_image_check_size(w, h, 0, r->s.avctx) < 0)
|
if ((ret = av_image_check_size(w, h, 0, r->s.avctx)) < 0)
|
||||||
return -1;
|
return ret;
|
||||||
si->width = w;
|
si->width = w;
|
||||||
si->height = h;
|
si->height = h;
|
||||||
mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
|
mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user