[06/18] rv34: Check the return value from ff_rv34_decode_init

Message ID 1379358389-64839-6-git-send-email-martin@martin.st
State Committed
Commit 711c970168297683860422e95d6b7e37ee3c8367
Headers show

Commit Message

Martin Storsjö Sept. 16, 2013, 7:06 p.m.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
---
 libavcodec/rv30.c |    4 +++-
 libavcodec/rv40.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Diego Biurrun Sept. 16, 2013, 9:19 p.m. | #1
On Mon, Sep 16, 2013 at 10:06:17PM +0300, Martin Storsjö wrote:
> Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: libav-stable@libav.org
> ---
>  libavcodec/rv30.c |    4 +++-
>  libavcodec/rv40.c |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)

LGTM

Diego

Patch

diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index f1f33c5..265ede3 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -243,9 +243,11 @@  static void rv30_loop_filter(RV34DecContext *r, int row)
 static av_cold int rv30_decode_init(AVCodecContext *avctx)
 {
     RV34DecContext *r = avctx->priv_data;
+    int ret;
 
     r->rv30 = 1;
-    ff_rv34_decode_init(avctx);
+    if ((ret = ff_rv34_decode_init(avctx)) < 0)
+        return ret;
     if(avctx->extradata_size < 2){
         av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
         return -1;
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index 6f8643d..d43d16b 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -544,9 +544,11 @@  static void rv40_loop_filter(RV34DecContext *r, int row)
 static av_cold int rv40_decode_init(AVCodecContext *avctx)
 {
     RV34DecContext *r = avctx->priv_data;
+    int ret;
 
     r->rv30 = 0;
-    ff_rv34_decode_init(avctx);
+    if ((ret = ff_rv34_decode_init(avctx)) < 0)
+        return ret;
     if(!aic_top_vlc.bits)
         rv40_init_tables();
     r->parse_slice_header = rv40_parse_slice_header;