CCodec: fix corner cases
am: ae9e2acb48

Change-Id: I14c7fb62fbde05c7ffffa3eaf2650ce3be146ee0