jpegls: factorize return paths
Conflicts:
libavcodec/jpeglsdec.c
(cherry picked from commit 4a4107b489
)
This commit is contained in:
@@ -259,7 +259,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
|||||||
int i, t = 0;
|
int i, t = 0;
|
||||||
uint8_t *zero, *last, *cur;
|
uint8_t *zero, *last, *cur;
|
||||||
JLSState *state;
|
JLSState *state;
|
||||||
int off = 0, stride = 1, width, shift;
|
int off = 0, stride = 1, width, shift, ret = 0;
|
||||||
|
|
||||||
zero = av_mallocz(s->picture_ptr->linesize[0]);
|
zero = av_mallocz(s->picture_ptr->linesize[0]);
|
||||||
last = zero;
|
last = zero;
|
||||||
@@ -329,9 +329,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
|||||||
}
|
}
|
||||||
} else if (ilv == 2) { /* sample interleaving */
|
} else if (ilv == 2) { /* sample interleaving */
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
|
||||||
av_free(state);
|
ret = AVERROR_PATCHWELCOME;
|
||||||
av_free(zero);
|
goto end;
|
||||||
return AVERROR_PATCHWELCOME;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shift){ /* we need to do point transform or normalize samples */
|
if(shift){ /* we need to do point transform or normalize samples */
|
||||||
@@ -359,10 +358,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
av_free(state);
|
av_free(state);
|
||||||
av_free(zero);
|
av_free(zero);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user