[FFmpeg-cvslog] avcodec/vc1: Don't pretend ff_vc1_init_common() can fail

Andreas Rheinhardt git at videolan.org
Mon Apr 12 19:57:08 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Tue Dec 22 17:55:19 2020 +0100| [c769050f56a8322091775af1f672803d8a42c775] | committer: Andreas Rheinhardt

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c769050f56a8322091775af1f672803d8a42c775
---

 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 --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 ea93e11588..a08f7fe847 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;



More information about the ffmpeg-cvslog mailing list