mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-18 05:24:42 +00:00
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>
This commit is contained in:
parent
331fae80a1
commit
4e9745fbff
@ -259,13 +259,13 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
|
|||||||
RV34DecContext *r = avctx->priv_data;
|
RV34DecContext *r = avctx->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (avctx->extradata_size < 2) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
r->rv30 = 1;
|
r->rv30 = 1;
|
||||||
if ((ret = ff_rv34_decode_init(avctx)) < 0)
|
if ((ret = ff_rv34_decode_init(avctx)) < 0)
|
||||||
return ret;
|
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;
|
r->max_rpr = avctx->extradata[1] & 7;
|
||||||
if(avctx->extradata_size < 2*r->max_rpr + 8){
|
if(avctx->extradata_size < 2*r->max_rpr + 8){
|
||||||
|
Loading…
Reference in New Issue
Block a user