Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-23 01:11:50 +0300
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-11-23 22:53:17 +0300
commit4e9745fbff5174c0679452b613b0b73f08ca0280 (patch)
tree84bef3c9463c6521d73d611d2f898f0c7a25e0af /libavcodec/rv30.c
parent331fae80a1fb9b027442047fb564c02c6c41e70b (diff)
lavc/rv30: fix mem leak in case of init failure
Also replaced return -1 with return AVERROR(EINVAL) Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavcodec/rv30.c')
-rw-r--r--libavcodec/rv30.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index fd8fd4f987..1483107c66 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -259,13 +259,13 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
RV34DecContext *r = avctx->priv_data;
int ret;
+ if (avctx->extradata_size < 2) {
+ av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
+ return AVERROR(EINVAL);
+ }
r->rv30 = 1;
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;
- }
r->max_rpr = avctx->extradata[1] & 7;
if(avctx->extradata_size < 2*r->max_rpr + 8){