mirror of https://git.ffmpeg.org/ffmpeg.git
lavc/flvdec: return meaningful error codes
This commit is contained in:
parent
0c71d5a077
commit
ac006d29d8
|
@ -40,12 +40,12 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
|
||||||
/* picture header */
|
/* picture header */
|
||||||
if (get_bits_long(&s->gb, 17) != 1) {
|
if (get_bits_long(&s->gb, 17) != 1) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
format = get_bits(&s->gb, 5);
|
format = get_bits(&s->gb, 5);
|
||||||
if (format != 0 && format != 1) {
|
if (format != 0 && format != 1) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Bad picture format\n");
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
s->h263_flv = format+1;
|
s->h263_flv = format+1;
|
||||||
s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
|
s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
|
||||||
|
@ -84,7 +84,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(av_image_check_size(width, height, 0, s->avctx))
|
if(av_image_check_size(width, height, 0, s->avctx))
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
s->width = width;
|
s->width = width;
|
||||||
s->height = height;
|
s->height = height;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue