avcodec/assenc: fix potential overread.