diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 09:57:42 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-05-31 09:57:42 +0000 |
commit | 1207c84adb5747d61b7ed0909d63c1a254716282 (patch) | |
tree | cefebd8dcec198e567b033be0146901a22a8d607 /libavcodec/lcldec.c | |
parent | c2c0c1c0232b875b9311274cd241a992bbb4d081 (diff) | |
download | ffmpeg-1207c84adb5747d61b7ed0909d63c1a254716282.tar.gz |
Use FFMIN
Originally committed as revision 19041 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lcldec.c')
-rw-r--r-- | libavcodec/lcldec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 89c6b03dd7..bfb2150f88 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -191,8 +191,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac if (c->flags & FLAG_MULTITHREAD) { mthread_inlen = *(unsigned int*)encoded; mthread_outlen = *(unsigned int*)(encoded+4); - if (mthread_outlen > c->decomp_size) // this should not happen - mthread_outlen = c->decomp_size; + mthread_outlen = FFMIN(mthread_outlen, c->decomp_size); mszh_dlen = mszh_decomp(encoded + 8, mthread_inlen, c->decomp_buf, c->decomp_size); if (mthread_outlen != mszh_dlen) { av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%d != %d)\n", @@ -238,8 +237,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac int ret; mthread_inlen = *(unsigned int*)encoded; mthread_outlen = *(unsigned int*)(encoded+4); - if (mthread_outlen > c->decomp_size) - mthread_outlen = c->decomp_size; + mthread_outlen = FFMIN(mthread_outlen, c->decomp_size); ret = zlib_decomp(avctx, encoded + 8, mthread_inlen, 0, mthread_outlen); if (ret < 0) return ret; ret = zlib_decomp(avctx, encoded + 8 + mthread_inlen, len - mthread_inlen, |