avcodec/magicyuvenc: Hoist check out of loop
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
d42ba1384a
commit
bad3f308d3
1 changed files with 6 additions and 4 deletions
|
|
@ -625,12 +625,14 @@ static av_cold int magy_encode_close(AVCodecContext *avctx)
|
|||
{
|
||||
MagicYUVContext *s = avctx->priv_data;
|
||||
|
||||
for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) {
|
||||
Slice *sl = &s->slices[i];
|
||||
if (s->slices) {
|
||||
for (int i = 0; i < s->planes * s->nb_slices; i++) {
|
||||
Slice *sl = &s->slices[i];
|
||||
|
||||
av_freep(&sl->slice);
|
||||
av_freep(&sl->slice);
|
||||
}
|
||||
av_freep(&s->slices);
|
||||
}
|
||||
av_freep(&s->slices);
|
||||
av_freep(&s->decorrelate_buf);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue