History

avcodec/vc1dec: Fix "return -1" cases

Michael Niedermayer committed 6 years ago

Commit 26f040b1 parent 3ee92401 file · +4 −4Browse files

Unified · Split

libavcodec/vc1dec.c+4−4
@@ -431,7 +431,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 430 unmodified lines
431431 v->output_height = avctx->height;
432432
433433 if (!avctx->extradata_size || !avctx->extradata)
434− return -1;
434+ return AVERROR_INVALIDDATA;
435435 v->s.avctx = avctx;
436436
437437 if ((ret = ff_vc1_init_common(v)) < 0)
@@ -472,7 +472,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 34 unmodified lines
472472
473473 if (avctx->extradata_size < 16) {
474474 av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);
475− return -1;
475+ return AVERROR_INVALIDDATA;
476476 }
477477
478478 buf2 = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
@@ -508,7 +508,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 29 unmodified lines
508508 av_free(buf2);
509509 if (!seq_initialized || !ep_initialized) {
510510 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
511− return -1;
511+ return AVERROR_INVALIDDATA;
512512 }
513513 v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
514514 }
@@ -577,7 +577,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 62 unmodified lines
577577 v->sprite_height > 1 << 14 ||
578578 v->output_width > 1 << 14 ||
579579 v->output_height > 1 << 14) {
580− ret = -1;
580+ ret = AVERROR_INVALIDDATA;
581581 goto error;
582582 }
583583

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t