mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-14 20:33:00 +02:00
jpegls: factorize return paths
This commit is contained in:
parent
a5a0ef5e13
commit
4a4107b489
@ -274,7 +274,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
|
|||||||
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;
|
||||||
@ -347,9 +347,8 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
|
|||||||
}
|
}
|
||||||
} else if (ilv == 2) { /* sample interleaving */
|
} else if (ilv == 2) { /* sample interleaving */
|
||||||
avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
|
avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
|
||||||
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 */
|
||||||
@ -375,10 +374,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
av_free(state);
|
av_free(state);
|
||||||
av_free(zero);
|
av_free(zero);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVCodec ff_jpegls_decoder = {
|
AVCodec ff_jpegls_decoder = {
|
||||||
|
Loading…
Reference in New Issue
Block a user