avcodec/h264addpx_template: Fixes integer overflows