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
431 v->output_height = avctx->height;431 v->output_height = avctx->height;
432 432
433 if (!avctx->extradata_size || !avctx->extradata)433 if (!avctx->extradata_size || !avctx->extradata)
434 return -1;434 return AVERROR_INVALIDDATA;
435 v->s.avctx = avctx;435 v->s.avctx = avctx;
436 436
437 if ((ret = ff_vc1_init_common(v)) < 0)437 if ((ret = ff_vc1_init_common(v)) < 0)
@@ -472,7 +472,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 34 unmodified lines
472 472
473 if (avctx->extradata_size < 16) {473 if (avctx->extradata_size < 16) {
474 av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);474 av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);
475 return -1;475 return AVERROR_INVALIDDATA;
476 }476 }
477 477
478 buf2 = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);478 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
508 av_free(buf2);508 av_free(buf2);
509 if (!seq_initialized || !ep_initialized) {509 if (!seq_initialized || !ep_initialized) {
510 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");510 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
511 return -1;511 return AVERROR_INVALIDDATA;
512 }512 }
513 v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);513 v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
514 }514 }
@@ -577,7 +577,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 62 unmodified lines
577 v->sprite_height > 1 << 14 ||577 v->sprite_height > 1 << 14 ||
578 v->output_width > 1 << 14 ||578 v->output_width > 1 << 14 ||
579 v->output_height > 1 << 14) {579 v->output_height > 1 << 14) {
580 ret = -1;580 ret = AVERROR_INVALIDDATA;
581 goto error;581 goto error;
582 }582 }
583 583

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