Browse Source

avcodec/vc1: Don't pretend ff_vc1_init_common() can fail

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
master
Andreas Rheinhardt Andreas Rheinhardt 5 years ago
parent
commit
c769050f56
5 changed files with 6 additions and 9 deletions
  1. +1
    -2
      libavcodec/mss2.c
  2. +1
    -3
      libavcodec/vc1.c
  3. +1
    -1
      libavcodec/vc1.h
  4. +2
    -1
      libavcodec/vc1_parser.c
  5. +1
    -2
      libavcodec/vc1dec.c

+ 1
- 2
libavcodec/mss2.c View File

@@ -751,8 +751,7 @@ static av_cold int wmv9_init(AVCodecContext *avctx)

v->s.avctx = avctx;

if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
ff_vc1_init_common(v);
ff_vc1dsp_init(&v->vc1dsp);

v->profile = PROFILE_MAIN;


+ 1
- 3
libavcodec/vc1.c View File

@@ -1695,7 +1695,7 @@ static av_cold void vc1_init_static(void)
* @param v The VC1Context to initialize
* @return Status
*/
av_cold int ff_vc1_init_common(VC1Context *v)
av_cold void ff_vc1_init_common(VC1Context *v)
{
static AVOnce init_static_once = AV_ONCE_INIT;

@@ -1709,6 +1709,4 @@ av_cold int ff_vc1_init_common(VC1Context *v)

/* VLC tables */
ff_thread_once(&init_static_once, vc1_init_static);

return 0;
}

+ 1
- 1
libavcodec/vc1.h View File

@@ -413,7 +413,7 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex

int ff_vc1_parse_frame_header (VC1Context *v, GetBitContext *gb);
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb);
int ff_vc1_init_common(VC1Context *v);
void ff_vc1_init_common(VC1Context *v);

int ff_vc1_decode_init_alloc_tables(VC1Context *v);
void ff_vc1_init_transposed_scantables(VC1Context *v);


+ 2
- 1
libavcodec/vc1_parser.c View File

@@ -283,7 +283,8 @@ static av_cold int vc1_parse_init(AVCodecParserContext *s)
vpc->bytes_to_skip = 0;
vpc->unesc_index = 0;
vpc->search_state = NO_MATCH;
return ff_vc1_init_common(&vpc->v);
ff_vc1_init_common(&vpc->v);
return 0;
}

AVCodecParser ff_vc1_parser = {


+ 1
- 2
libavcodec/vc1dec.c View File

@@ -434,8 +434,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
v->s.avctx = avctx;

if ((ret = ff_vc1_init_common(v)) < 0)
return ret;
ff_vc1_init_common(v);

if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) {
int count = 0;


Loading…
Cancel
Save