diff mbox series

[FFmpeg-devel,3/7] avcodec/vc1: Don't pretend ff_vc1_init_common() can fail

Message ID 20201225154724.287465-3-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/7] avcodec/mpeg12dec: Remove update_thread_context
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 25, 2020, 3:47 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mss2.c       | 3 +--
 libavcodec/vc1.c        | 4 +---
 libavcodec/vc1.h        | 2 +-
 libavcodec/vc1_parser.c | 3 ++-
 libavcodec/vc1dec.c     | 3 +--
 5 files changed, 6 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 9434a740a7..3e3205ae92 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -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;
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index cd9975d8cf..5d854b35d2 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -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;
 }
diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h
index 4559a06cb6..3e5368b891 100644
--- a/libavcodec/vc1.h
+++ b/libavcodec/vc1.h
@@ -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);
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index 493ffde611..1a9d3c0140 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -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 = {
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 5cdf197da7..78988b740c 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -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;