forked from FFmpeg/FFmpeg
avcodec/vc2enc_dwt: Avoid NULL - 0
It is sane, but UB. It could happen in case of allocation errors in vc2_encode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
fb36af3b66
commit
31da97b083
1 changed files with 4 additions and 2 deletions
|
@ -276,6 +276,8 @@ av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_stride,
|
||||||
|
|
||||||
av_cold void ff_vc2enc_free_transforms(VC2TransformContext *s)
|
av_cold void ff_vc2enc_free_transforms(VC2TransformContext *s)
|
||||||
{
|
{
|
||||||
av_free(s->buffer - s->padding);
|
if (s->buffer) {
|
||||||
s->buffer = NULL;
|
av_free(s->buffer - s->padding);
|
||||||
|
s->buffer = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue