diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-18 17:26:00 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-18 17:26:00 +0000 |
commit | f63f689e101225d2a35f614c8843e7bdcdadee78 (patch) | |
tree | b245711ea12fc687dc201bfd2e03c37b1fc33e7c | |
parent | 7b7b19b620e25d7b692071a8af0e47a7b2a8a3e6 (diff) | |
download | ffmpeg-f63f689e101225d2a35f614c8843e7bdcdadee78.tar.gz |
Avoid code duplication in xan_unpack for the final memcpy.
Originally committed as revision 18608 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/xan.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 748f4d1eab..aacdcc1b83 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -157,17 +157,18 @@ static void xan_unpack(unsigned char *dest, const unsigned char *src, int dest_l av_memcpy_backptr(dest, back, size2); dest += size2; } else { + int finish; size = ((opcode & 0x1f) << 2) + 4; - if (size > 0x70) - break; + finish = size > 0x70; + if (finish) + size = opcode & 3; memcpy(dest, src, size); dest += size; src += size; + if (finish) + return; } } - - size = opcode & 3; - memcpy(dest, src, size); dest += size; src += size; } static inline void xan_wc3_output_pixel_run(XanContext *s, |