avcodec/truemotion2: Fix av_freep arguments
Fixes null pointer dereference
Fixes Ticket2944
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c54aa2fb0f
)
Conflicts:
libavcodec/truemotion2.c
This commit is contained in:
@@ -945,14 +945,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
|
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
|
||||||
!l->V1_base || !l->U2_base || !l->V2_base ||
|
!l->V1_base || !l->U2_base || !l->V2_base ||
|
||||||
!l->last || !l->clast) {
|
!l->last || !l->clast) {
|
||||||
av_freep(l->Y1_base);
|
av_freep(&l->Y1_base);
|
||||||
av_freep(l->Y2_base);
|
av_freep(&l->Y2_base);
|
||||||
av_freep(l->U1_base);
|
av_freep(&l->U1_base);
|
||||||
av_freep(l->U2_base);
|
av_freep(&l->U2_base);
|
||||||
av_freep(l->V1_base);
|
av_freep(&l->V1_base);
|
||||||
av_freep(l->V2_base);
|
av_freep(&l->V2_base);
|
||||||
av_freep(l->last);
|
av_freep(&l->last);
|
||||||
av_freep(l->clast);
|
av_freep(&l->clast);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
l->Y1 = l->Y1_base + l->y_stride * 4 + 4;
|
l->Y1 = l->Y1_base + l->y_stride * 4 + 4;
|
||||||
|
Reference in New Issue
Block a user