Unified · Split
| @@ -984,15 +984,6 @@ static av_cold int decode_init(AVCodecContext *avctx) · 983 unmodified lines | ||
| 984 | 984 | if (!l->Y1_base || !l->Y2_base || !l->U1_base || |
| 985 | 985 | !l->V1_base || !l->U2_base || !l->V2_base || |
| 986 | 986 | !l->last || !l->clast) { |
| 987 | − av_freep(&l->Y1_base); | |
| 988 | − av_freep(&l->Y2_base); | |
| 989 | − av_freep(&l->U1_base); | |
| 990 | − av_freep(&l->U2_base); | |
| 991 | − av_freep(&l->V1_base); | |
| 992 | − av_freep(&l->V2_base); | |
| 993 | − av_freep(&l->last); | |
| 994 | − av_freep(&l->clast); | |
| 995 | − av_frame_free(&l->pic); | |
| 996 | 987 | return AVERROR(ENOMEM); |
| 997 | 988 | } |
| 998 | 989 | l->Y1 = l->Y1_base + l->y_stride * 4 + 4; |
| @@ -1014,14 +1005,13 @@ static av_cold int decode_end(AVCodecContext *avctx) · 15 unmodified lines | ||
| 1014 | 1005 | av_freep(&l->clast); |
| 1015 | 1006 | for (i = 0; i < TM2_NUM_STREAMS; i++) |
| 1016 | 1007 | av_freep(&l->tokens[i]); |
| 1017 | − if (l->Y1) { | |
| 1008 | + | |
| 1018 | 1009 | av_freep(&l->Y1_base); |
| 1019 | 1010 | av_freep(&l->U1_base); |
| 1020 | 1011 | av_freep(&l->V1_base); |
| 1021 | 1012 | av_freep(&l->Y2_base); |
| 1022 | 1013 | av_freep(&l->U2_base); |
| 1023 | 1014 | av_freep(&l->V2_base); |
| 1024 | − } | |
| 1025 | 1015 | av_freep(&l->buffer); |
| 1026 | 1016 | l->buffer_size = 0; |
| 1027 | 1017 | |
| @@ -1040,4 +1030,5 @@ AVCodec ff_truemotion2_decoder = { · 12 unmodified lines | ||
| 1040 | 1030 | .close = decode_end, |
| 1041 | 1031 | .decode = decode_frame, |
| 1042 | 1032 | .capabilities = AV_CODEC_CAP_DR1, |
| 1033 | + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, | |
| 1043 | 1034 | }; |